]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/main.cpp
fixed wxTempFile::Commit() broken by last check in
[wxWidgets.git] / src / msw / main.cpp
index 13c6321b2bb40e563e23399b88451127b2efadb4..5617b1f15caa3ae57d0da7ee14457a0aeee6463b 100644 (file)
@@ -28,7 +28,6 @@
     #pragma hdrstop
 #endif
 
-#include "wx/init.h"
 #include "wx/event.h"
 #include "wx/app.h"
 #include "wx/cmdline.h"
@@ -69,13 +68,13 @@ static wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc);
 // Windows-specific wxEntry
 // ----------------------------------------------------------------------------
 
-int wxEntry(WXHINSTANCE hInstance,
-            WXHINSTANCE WXUNUSED(hPrevInstance),
-            char *pCmdLine,
-            int nCmdShow)
+WXDLLEXPORT int wxEntry(HINSTANCE hInstance,
+                        HINSTANCE WXUNUSED(hPrevInstance),
+                        char *pCmdLine,
+                        int nCmdShow)
 {
     // remember the parameters Windows gave us
-    wxSetInstance((HINSTANCE)hInstance);
+    wxSetInstance(hInstance);
     wxApp::m_nCmdShow = nCmdShow;
 
     // parse the command line
@@ -101,16 +100,23 @@ 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,
                    int nCmdShow)
 {
-    return wxEntry((WXHINSTANCE) hInstance,
-                   (WXHINSTANCE) hPrevInstance,
-                   lpCmdLine,
-                   nCmdShow);
+    return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
 }
+#endif
 
 #else // _WINDLL
 
@@ -127,7 +133,7 @@ DllMain(HANDLE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved))
     switch (fdwReason)
     {
         case DLL_PROCESS_ATTACH:
-            return wxEntry((WXHINSTANCE) hModule);
+            return wxEntry(hModule);
 
         case DLL_PROCESS_DETACH:
             wxEntryCleanup();