how to build plain-dos EXE using Borland C++ 3.1 which uses WINAPI

  • Thread starter Przemys³aw Dmochowski
  • Start date
P

Przemys³aw Dmochowski

Please help me.

I need to use some of Windows API, but my program must be also runnable from
plain dos.

I can not simply switch target to Win app. :(

Question: how link program witch <windows.h> included, but with plain DOS
startup code?

My program should detect if is running under windows and then use some of
API calls.
 
J

Jarmo

Przemys³aw Dmochowski said:
Please help me.

I need to use some of Windows API, but my program must be also runnable from
plain dos.

I can not simply switch target to Win app. :(

Question: how link program witch <windows.h> included, but with plain DOS
startup code?

My program should detect if is running under windows and then use some of
API calls.

I'd build two versions of the program, one for DOS and one for Windows.
Then build a third program that execs on of the other two depending on the
OS.

PS you're asking in the wrong newsgroup.
 
W

Walter

Przemys³aw Dmochowski said:
I need to use some of Windows API, but my program must be also runnable from
plain dos.

Build a dos version, then a windows version. When linking the windows
version, use the dos version as the "stub executable". Then, even though the
result is only one big executable file, the dos version will run when in
dos, and the windows version will run when run under windows. This even
works when the dos version is a 32 bit dos extended version. I used to do
this all the time, it works great.

-Walter
www.digitalmars.com free C/C++/D compilers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top