+#if wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// function prototypes
+// ----------------------------------------------------------------------------
+
+// from src/msw/app.cpp
+extern void WXDLLEXPORT wxEntryCleanup();
+
+static wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc);
+
+// ============================================================================
+// implementation: various entry points
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// Windows-specific wxEntry
+// ----------------------------------------------------------------------------
+
+WXDLLEXPORT int wxEntry(HINSTANCE hInstance,
+ HINSTANCE WXUNUSED(hPrevInstance),
+ char *pCmdLine,
+ int nCmdShow)
+{
+ // remember the parameters Windows gave us
+ wxSetInstance(hInstance);
+ wxApp::m_nCmdShow = nCmdShow;
+
+ // parse the command line
+ int argc;
+ wxChar **argv = ConvertToStandardCommandArgs(wxConvertMB2WX(pCmdLine), argc);
+
+ return wxEntry(argc, argv);
+}
+
+// May wish not to have a DllMain or WinMain, e.g. if we're programming
+// a Netscape plugin or if we're writing a console application
+#if !defined(NOMAIN)
+
+extern "C"
+{
+
+// ----------------------------------------------------------------------------