#if wxUSE_BASE
-#if defined(__VISUALC__) && !defined(__WXWINCE__)
+#if wxUSE_ON_FATAL_EXCEPTION && defined(__VISUALC__) && !defined(__WXWINCE__)
// VC++ (at least from 4.0 up to version 7.1) is incredibly broken in that
// a "catch ( ... )" will *always* catch SEH exceptions in it even though
// it should have never been the case... to prevent such catches from
// DLL entry point
BOOL WINAPI
-DllMain(HANDLE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved))
+DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved))
{
// Only call wxEntry if the application itself is part of the DLL.
// If only the wxWidgets library is in the DLL, then the