Forum Navigation
WinMain in Tango
Posted: 09/21/07 09:09:28Hi I am going to write a Win GUI toolkit, (using Tango of course) I guess, I have to modify the Phobos code a bit. Sorry, I have not found something within the WIKI.
extern (C) void gc_init(); extern (C) void gc_term(); extern (C) void _minit(); extern (C) void _moduleCtor(); extern (C) void _moduleUnitTests(); extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int result; gc_init(); // initialize garbage collector _minit(); // initialize module constructor table try { _moduleCtor(); // call module constructors _moduleUnitTests(); // run unit tests (optional) result = doit(); // insert user code here } catch (Object o) // catch any uncaught exceptions { MessageBoxA(null, cast(char *)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION); result = 0; // failed } gc_term(); // run finalizers; terminate garbage collector return result; }So folks, how do I define an adequate Tango WinMain? function... Many Thanks in advance, Bjoern












