]> git.tdb.fi Git - libs/core.git/blobdiff - source/main.cpp
WinMain for Win32
[libs/core.git] / source / main.cpp
index 7b1b11e91e62aaffdef49ce64ce952291de3ca21..4b187c3ed244b35491658ee66ee14aeb08419cc0 100644 (file)
@@ -3,7 +3,20 @@ This file is part of libmspframework
 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #include "application.h"
 
+#ifdef WIN32
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+{ 
+       int argc        = 0;
+       LPWSTR *argv    = CommandLineToArgvW(GetCommandLineW(), &argc);
+       return Msp::Application::run(argc, (char **)argv);
+}
+#endif
+
 int main(int argc, char **argv)
 { return Msp::Application::run(argc, argv); }