Re: Command Window with MSVC++ GTK apps



On Tue, 2006-10-03 at 16:19, Christopher Backhouse wrote:
Lots of my code has this at the top of it

#pragma comment(linker, "/subsystem:\"windows\" 
/entry:\"mainCRTStartup\"")  //Kill console window

I got it off the internet somewhere.
I assume the unrecognised pragma will be ignored by every other compiler 
out there so it should be "portable" (if a little ugly)
Is it possible to just add the string in this command somewhere into the 
link options?

That's it! The voodoo was in the name of the entry point. As I said, I
had tried "main" but that didn't work. The actual desired entry point
was "mainCRTStartup".

So adding "/subsystem:windows /entry:mainCRTStartup" to the linker
options alters a former console app to execute without the console
window. Same effect as running "editbin /subsystem:windows" on the
console executable as described by Tor a few messages ago.





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