Board index » delphi » Windows program keeps opening a DOS window.

Windows program keeps opening a DOS window.

I'm using Borland C++ 5.02 along with a 1994 version of the MKS
make utility.  I've managed to write a compact make file to compi
the listctrl demo that comes with the compiler and it works
great except every time I run the executable it opens a DOS window
first if it wasn't launched from one.  If it opens one itself, it
also closes it on exit.  I'm compiling each .c file with only
bcc32 -c and am linking the resulting object files with the
provided c0w32.obj, import32.lib, user32.lib, and cw32i.lib.

I've had a lot of success with this particular compiler/make
combination, so I'd like to continue to use it (and develop
from the command line) if at all possible.  Thanks.

 

Re:Windows program keeps opening a DOS window.


What you describe is normal behavior for a Win32 Console Mode program.  If
you want to keep the window open then put getchar(); on the last line before
the return statement in main.  It will wait for you to press Enter.

.  Ed

Re:Windows program keeps opening a DOS window.


ed,

i noticed that you mentioned c0w32.obj. i was wondering if you could help me with a newbie problem. i just installed bcc32 & turbo de{*word*81}, but i keep getting the error . . . Fatal: Unable to open file 'COX32.OBJ'. any ideas?

patrick

Quote
"Ed Krauss" <e...@chemicalsafety.com> wrote:

>I'm using Borland C++ 5.02 along with a 1994 version of the MKS
>make utility.  I've managed to write a compact make file to compi
>the listctrl demo that comes with the compiler and it works
>great except every time I run the executable it opens a DOS window
>first if it wasn't launched from one.  If it opens one itself, it
>also closes it on exit.  I'm compiling each .c file with only
>bcc32 -c and am linking the resulting object files with the
>provided c0w32.obj, import32.lib, user32.lib, and cw32i.lib.

>I've had a lot of success with this particular compiler/make
>combination, so I'd like to continue to use it (and develop
>from the command line) if at all possible.  Thanks.

Re:Windows program keeps opening a DOS window.


Quote
"patrick" <pjm...@psualum.com> wrote:
>i noticed that you mentioned c0w32.obj. i was wondering if you
>could help me with a newbie problem. i just installed bcc32 &
>turbo de{*word*81}, but i keep getting the error . . . Fatal:
>Unable to open file 'COX32.OBJ'. any ideas?

That file is in my \bc5\lib directory.  Check the paths settings
under make or project in the IDE.  Maybe it's not set to look
in the \bc5\lib directory for OBJs, or put in the full path name
whereever it's referenced.

Ed

Re:Windows program keeps opening a DOS window.


"Ed Mulroy [TeamB]" <e...@mulroy.org> wrote:

Quote
>What you describe is normal behavior for a Win32 Console Mode program.  If
>you want to keep the window open then put getchar(); on the last line before
>the return statement in main.  It will wait for you to press Enter.

Sorry for not making myself clearer, what I'd like to do is not
have this behavior.  Undoubtly it must involve an additional
compile and/or link switch, and/or combination of additional
compiler provided OBJs and LIBs to link in.  My goal, is to
have as simple as possible make settings, that I control and
run from the command line, which generate a Windows app that
can be launched by clicking on its icon WITHOUT it opening a
DOS window.  I'm able to do this with the out-of-the-box
Borland command line Make but they've thrown WAY TOO MUCH
into it.  I've so far paired the whole thing down to just
a half dozen lines.  Now all I'm missing is whatever switches
and/or files to link in to give me normal Windows app behavior
that won't open DOS windows in the background and WILL
immediately return to the DOS prompt when run from a DOS prompt.

Thanks,

Ed

Other Threads