1. fixed crash in wxDateTime::ParseDate

2. some DLL compilation fixes
3. wxHandleFatalExceptions() implemented for MSW and documented
4. some attempts to make setup0.h a bit nicer


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-03-19 00:56:22 +00:00
parent b59c98ddb8
commit 3b415ba4cd
6 changed files with 296 additions and 183 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ SOURCE=.\src\msw\dummydll.cpp
#$ ExpandGlue("WXGENERICSRCS", "# Begin Source File\n\nSOURCE=.\\src\\generic\\", "\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\generic\\", "\n# End Source File\n");
#$ ExpandGlue("WXCOMMONSRCS", "# Begin Source File\n\nSOURCE=.\\src\\common\\", "\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\common\\", "\n# End Source File\n");
#$ ExpandGlue("WXCSRCS", "# Begin Source File\n\nSOURCE=.\\src\\common\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\common\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n");
#$ ExpandGlue("WXMSWCSRCS", "# Begin Source File\n\nSOURCE=.\\src\\msw\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\common\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n");
#$ ExpandGlue("WXMSWCSRCS", "# Begin Source File\n\nSOURCE=.\\src\\msw\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\msw\\", "\n# SUBTRACT CPP /YX /Yc /Yu\n# End Source File\n");
#$ ExpandGlue("WXHTMLSRCS", "# Begin Source File\n\nSOURCE=.\\src\\html\\", "\n# End Source File\n# Begin Source File\n\nSOURCE=.\\src\\html\\", "\n# End Source File\n");
# Begin Source File
+7 -1
View File
@@ -1552,7 +1552,13 @@ Under Windows, this returns ``unknown''.
\func{bool}{wxHandleFatalExceptions}{\param{bool}{ doIt = TRUE}}
Call this from e.g. \helpref{wxApp::OnFatalException}{wxapponfatalexception}.
If {\it doIt} is TRUE, the fatal exceptions (also known as general protection
faults under Windows or segmentation violations in the Unix world) will be
caught and passed to \helpref{wxApp::OnFatalException}{wxapponfatalexception}.
By default, i.e. before this function is called, they will be handled in the
normal way which usually just means that the application will be terminated.
Calling wxHandleFatalExceptions() with {\it doIt} equal to FALSE will restore
this default behaviour.
\membersection{::wxKill}\label{wxkill}
+256 -164
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2987,7 +2987,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
{
wxString date = wxGetTranslation(literalDates[n].str);
size_t len = date.length();
if ( wxString(p, len).CmpNoCase(date) == 0 )
if ( wxStrlen(p) >= len && (wxString(p, len).CmpNoCase(date) == 0) )
{
// nothing can follow this, so stop here
p += len;
+29 -14
View File
@@ -155,6 +155,10 @@ HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
#if wxUSE_ON_FATAL_EXCEPTION
static bool gs_handleExceptions = FALSE;
#endif
// ===========================================================================
// implementation
// ===========================================================================
@@ -652,16 +656,15 @@ int wxEntry(WXHINSTANCE hInstance,
wxDebugContext::SetCheckpoint();
#endif
#endif
// take everything into a try-except block in release build
// take everything into a try-except block to be able to call
// OnFatalException() if necessary
// FIXME other compilers must support Win32 SEH (structured exception
// handling) too, just find the appropriate keyword in their docs!
// Please note that it's _not_ the same as C++ exceptions!
#if !defined(__WXDEBUG__) && defined(__VISUALC__)
#define CATCH_PROGRAM_EXCEPTIONS
#if wxUSE_ON_FATAL_EXCEPTION
__try {
#else
#undef CATCH_PROGRAM_EXCEPTIONS
#endif
wxhInstance = (HINSTANCE) hInstance;
@@ -734,13 +737,12 @@ int wxEntry(WXHINSTANCE hInstance,
return retValue;
#ifdef CATCH_PROGRAM_EXCEPTIONS
#if wxUSE_ON_FATAL_EXCEPTION
}
__except ( EXCEPTION_EXECUTE_HANDLER ) {
/*
if ( wxTheApp )
__except ( gs_handleExceptions ? EXCEPTION_EXECUTE_HANDLER
: EXCEPTION_CONTINUE_SEARCH ) {
if ( wxTheApp )
wxTheApp->OnFatalException();
*/
// using wxLog would be unsafe here
::MessageBox(NULL,
@@ -753,7 +755,7 @@ int wxEntry(WXHINSTANCE hInstance,
// NOTREACHED
}
#endif // CATCH_PROGRAM_EXCEPTIONS
#endif // wxUSE_ON_FATAL_EXCEPTION
}
// restore warning state
@@ -837,8 +839,7 @@ bool wxApp::Initialized()
return TRUE;
else
return FALSE;
#endif
#ifdef _WINDLL // Assume initialized if DLL (no way of telling)
#else // Assume initialized if DLL (no way of telling)
return TRUE;
#endif
}
@@ -1280,6 +1281,20 @@ bool wxYield()
return TRUE;
}
bool wxHandleFatalExceptions(bool doit)
{
#if wxUSE_ON_FATAL_EXCEPTION
// assume this can only be called from the main thread
gs_handleExceptions = doit;
return TRUE;
#else
wxFAIL_MSG(_T("set wxUSE_ON_FATAL_EXCEPTION to 1 to sue this function"));
return FALSE;
#endif
}
//-----------------------------------------------------------------------------
// wxWakeUpIdle
//-----------------------------------------------------------------------------
+2 -2
View File
@@ -128,7 +128,7 @@
#endif // ASCII/Unicode
// structure passed to the secondary thread
struct wxRasThreadData
struct WXDLLEXPORT wxRasThreadData
{
wxRasThreadData()
{
@@ -199,7 +199,7 @@ private:
void CleanUpThreadData();
// timer used for polling RAS status
class RasTimer : public wxTimer
class WXDLLEXPORT RasTimer : public wxTimer
{
public:
RasTimer(wxDialUpManagerMSW *dialUpManager)