Is it possible, to in Windows, create a GUI program, which has it's entry point in 'main()'? How do I do this?
My use for this is that I want a cross-platform application, with one uniform entry point.
Is it possible, to in Windows, create a GUI program, which has it's entry point in 'main()'? How do I do this?
My use for this is that I want a cross-platform application, with one uniform entry point.
main()
and all the GUI calls in there that you would have used inWinMain
. This will create an application with both a GUI and a console window.editbin /SUBSYSTEM:WINDOWS appname.exe
to change the subsystem flag in the PE header, so Windows won't create a console window automatically.stdout
for debug message or the like, you can either usefreopen
to directstdout
to a file, orAllocConsole
when you decide a console window is needed (for example, after an error occurs).BTW: This thread indicates that the DMD compiler will prefer
main()
overWinMain()
anyway if it finds both.