git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21531
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#define IMPLEMENT_WXWIN_MAIN \
int main(int argc, char **argv) { return wxEntry(argc, argv); }
#elif defined(__WXMSW__) && defined(WXUSINGDLL)
#define IMPLEMENT_WXWIN_MAIN \
int main(int argc, char **argv) { return wxEntry(argc, argv); }
#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, \
- WXHINSTANCE hPrevInstance, \
- char *pCmdLine, \
- int nCmdShow); \
- extern "C" int wxSTDCALL WinMain(WXHINSTANCE hInstance, \
- WXHINSTANCE hPrevInstance, \
- char *lpCmdLine, \
- int nCmdShow) \
+ extern int wxEntry(HINSTANCE hInstance, \
+ HINSTANCE hPrevInstance = NULL, \
+ char *pCmdLine = NULL, \
+ int nCmdShow = SW_NORMAL); \
+ extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
+ HINSTANCE hPrevInstance, \
+ char *lpCmdLine, \
+ int nCmdShow) \
{ \
return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \
}
{ \
return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \
}
#include "wx/event.h"
#include "wx/app.h"
#include "wx/cmdline.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/cmdline.h"
// Windows-specific wxEntry
// ----------------------------------------------------------------------------
// Windows-specific wxEntry
// ----------------------------------------------------------------------------
-int wxEntry(WXHINSTANCE hInstance,
- WXHINSTANCE WXUNUSED(hPrevInstance),
+int wxEntry(HINSTANCE hInstance,
+ HINSTANCE WXUNUSED(hPrevInstance),
char *pCmdLine,
int nCmdShow)
{
// remember the parameters Windows gave us
char *pCmdLine,
int nCmdShow)
{
// remember the parameters Windows gave us
- wxSetInstance((HINSTANCE)hInstance);
+ wxSetInstance(hInstance);
wxApp::m_nCmdShow = nCmdShow;
// parse the command line
wxApp::m_nCmdShow = nCmdShow;
// parse the command line
LPSTR lpCmdLine,
int nCmdShow)
{
LPSTR lpCmdLine,
int nCmdShow)
{
- return wxEntry((WXHINSTANCE) hInstance,
- (WXHINSTANCE) hPrevInstance,
- lpCmdLine,
- nCmdShow);
+ return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
- return wxEntry((WXHINSTANCE) hModule);
+ return wxEntry(hModule);
case DLL_PROCESS_DETACH:
wxEntryCleanup();
case DLL_PROCESS_DETACH:
wxEntryCleanup();