Re: windows resource files



Gorshkov writes:
I assume that in order to get rid of that, I have to turn my "ordinary" DOS 
programme into a windows programme -

First a clarification: There is absolutely nothing DOS-related in your
programme even if it requires a console window to run. It is still a
100% Win32 executable. There is a simply a single flag in the
executable file's header that tells whether it's a "console" or "gui"
application.

You just need to set the "gui" flag when linking. What you are looking
for is the -mwindows option to gcc. No resource files needed.

With a suitable tool one can even manipulate the flag afterwards. I
don't think the GNU toolchain includes such a tool, but editbin.exe
which comes with MSVC can do it.

It's perhaps a good idea to tell you now before you start scratching
your head in vain, that gui executables by default don't have stdout,
stderr or stdin attached to anything. Not even if you start them from
a command prompt in a console window. You need to explicitly redirect
I/O to/from files on the command line, or re-open stdout/err in your
code if you want to print debugging output or whatever.

And what's even more irritating is that even if you start the program
from a command prompt, the program has no knowledge of that, and there
is no way for it to write to that console window... (Well, there might
be some way to find out that is implemented only on XP, I don't
recall.)

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]