]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/main.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Main/DllMain
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 // May wish not to have a DllMain or WinMain, e.g. if we're programming
31 // NT defines APIENTRY, 3.x not
32 #if !defined(APIENTRY)
33 #define APIENTRY FAR PASCAL
36 /////////////////////////////////////////////////////////////////////////////////
38 // Note that WinMain is also defined in dummy.obj, which is linked to
39 // an application that is using the DLL version of wxWindows.
43 #if defined(__TWIN32__) || defined(__WXWINE__)
46 BOOL PASCAL
WinMain(HANDLE hInstance
, HANDLE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
56 WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
61 return wxEntry((WXHINSTANCE
) hInstance
, (WXHINSTANCE
) hPrevInstance
, lpCmdLine
, nCmdShow
);
65 /////////////////////////////////////////////////////////////////////////////////
74 // SCD: I don't know why, but also OWL uses this function
75 BOOL WINAPI
DllEntryPoint (HANDLE hModule
, DWORD fdwReason
, LPVOID lpReserved
)
77 BOOL WINAPI
DllMain (HANDLE hModule
, DWORD fdwReason
, LPVOID lpReserved
)
82 case DLL_PROCESS_ATTACH
:
83 // Only call wxEntry if the application itself is part of the DLL.
84 // If only the wxWindows library is in the DLL, then the initialisation
85 // will be called when the application implicitly calls WinMain.
87 #if !defined(WXMAKINGDLL)
88 return wxEntry((WXHINSTANCE
) hModule
);
92 case DLL_PROCESS_DETACH
: