Application with WinMain does not start

Minas Mina via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 5 05:16:19 PST 2016


I added a WinMain function to my application because I don't want 
it to open a console when running on windows.

But now it doesn't even start...

extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
               LPSTR lpCmdLine, int nCmdShow)
{
     bool b = true;
     while (b)
     {
         sync(Clock.currTime(utcTimeZone()));
         Thread.sleep(getNextTimeToRun() - 
Clock.currTime(utcTimeZone()));
     }
	
     return 0;
}

And this is my DUB configuration:

name "..."
description "..."
copyright "..."
authors "..."
targetType "executable"
lflags "/SUBSYSTEM:windows" "/EXETYPE:NT" platform="windows"

I got those flags from here: http://wiki.dlang.org/D_for_Win32

Any ideas:


More information about the Digitalmars-d-learn mailing list