we can't declare WinMain() with other arguments using Borland, revert to including windows.h

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-06-30 21:49:00 +00:00
parent 6b7cbde472
commit 13bdd545fb
2 changed files with 17 additions and 17 deletions

View File

@ -557,15 +557,19 @@ public:
#define IMPLEMENT_WXWIN_MAIN \ #define IMPLEMENT_WXWIN_MAIN \
int main(int argc, char **argv) { return wxEntry(argc, argv); } int main(int argc, char **argv) { return wxEntry(argc, argv); }
#elif defined(__WXMSW__) && defined(WXUSINGDLL) #elif defined(__WXMSW__) && defined(WXUSINGDLL)
// we need HINSTANCE declaration to define WinMain()
#include <windows.h>
#include "wx/msw/winundef.h"
#define IMPLEMENT_WXWIN_MAIN \ #define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry(WXHINSTANCE hInstance, \ extern int wxEntry(HINSTANCE hInstance, \
WXHINSTANCE hPrevInstance, \ HINSTANCE hPrevInstance = NULL, \
char *pCmdLine, \ char *pCmdLine = NULL, \
int nCmdShow); \ int nCmdShow = SW_NORMAL); \
extern "C" int wxSTDCALL WinMain(WXHINSTANCE hInstance, \ extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
WXHINSTANCE hPrevInstance, \ HINSTANCE hPrevInstance, \
char *lpCmdLine, \ char *lpCmdLine, \
int nCmdShow) \ int nCmdShow) \
{ \ { \
return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \ return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \
} }

View File

@ -28,7 +28,6 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#include "wx/init.h"
#include "wx/event.h" #include "wx/event.h"
#include "wx/app.h" #include "wx/app.h"
#include "wx/cmdline.h" #include "wx/cmdline.h"
@ -69,13 +68,13 @@ static wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc);
// Windows-specific wxEntry // Windows-specific wxEntry
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int wxEntry(WXHINSTANCE hInstance, int wxEntry(HINSTANCE hInstance,
WXHINSTANCE WXUNUSED(hPrevInstance), HINSTANCE WXUNUSED(hPrevInstance),
char *pCmdLine, char *pCmdLine,
int nCmdShow) int nCmdShow)
{ {
// remember the parameters Windows gave us // remember the parameters Windows gave us
wxSetInstance((HINSTANCE)hInstance); wxSetInstance(hInstance);
wxApp::m_nCmdShow = nCmdShow; wxApp::m_nCmdShow = nCmdShow;
// parse the command line // parse the command line
@ -106,10 +105,7 @@ int PASCAL WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int nCmdShow) int nCmdShow)
{ {
return wxEntry((WXHINSTANCE) hInstance, return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
(WXHINSTANCE) hPrevInstance,
lpCmdLine,
nCmdShow);
} }
#else // _WINDLL #else // _WINDLL
@ -127,7 +123,7 @@ DllMain(HANDLE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved))
switch (fdwReason) switch (fdwReason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
return wxEntry((WXHINSTANCE) hModule); return wxEntry(hModule);
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
wxEntryCleanup(); wxEntryCleanup();