X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3dfbbc91088ab32c3aae4294a3c726fadfc5ccd..4c3ebca927cea2742ec128c9c3ef3676d1ecae01:/src/msw/main.cpp diff --git a/src/msw/main.cpp b/src/msw/main.cpp index d53937131a..c293e7c511 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -30,7 +30,6 @@ #include "wx/event.h" #include "wx/app.h" -#include "wx/init.h" #include "wx/cmdline.h" #include "wx/msw/private.h" @@ -56,9 +55,6 @@ // function prototypes // ---------------------------------------------------------------------------- -// from src/msw/app.cpp -extern void WXDLLEXPORT wxEntryCleanup(); - static wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc); // ============================================================================ @@ -101,6 +97,15 @@ extern "C" #if !defined(_WINDLL) +#ifdef __WXWINCE__ +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + int nCmdShow) +{ + return wxEntry(hInstance, hPrevInstance, (char*) lpCmdLine, nCmdShow); +} +#else int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, @@ -108,6 +113,7 @@ int PASCAL WinMain(HINSTANCE hInstance, { return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); } +#endif #else // _WINDLL @@ -163,7 +169,9 @@ wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc) // and +1 here for the terminating NULL wxChar **argv = new wxChar *[argc + 1]; - argv[0] = new wxChar[MAX_PATH]; + // as we use wxStrdup below we must allocate the first argument using + // malloc(), not new[], as well + argv[0] = (wxChar *)malloc(MAX_PATH * sizeof(wxChar)); ::GetModuleFileName(wxhInstance, argv[0], MAX_PATH); // copy all the other arguments to wxApp::argv[]