From: Niko Liikanen Date: Thu, 24 Aug 2006 20:41:28 +0000 (+0000) Subject: WinMain for Win32 X-Git-Tag: 1.0~43 X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=ee0f34083d99c81ac1393bc1fddadfdadb201a38 WinMain for Win32 --- diff --git a/source/main.cpp b/source/main.cpp index 7b1b11e..4b187c3 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -3,7 +3,20 @@ This file is part of libmspframework Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ +#ifdef WIN32 +#include +#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); }