-bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file)
-{
- HAB hab;
- HINI hIni;
- static const wxChar defunkt[] = _T("$$default");
-
- if (file != "")
- {
- hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST file);
- if (hIni != 0L)
- {
- ULONG n = ::PrfQueryProfileString( hIni
- ,(PSZ)WXSTRINGCAST section
- ,(PSZ)WXSTRINGCAST entry
- ,(PSZ)defunkt
- ,(void*)wxBuffer
- ,1000
- );
- if (n == 0L || wxStrcmp(wxBuffer, defunkt) == 0)
- return FALSE;
- }
- else
- return FALSE;
- }
- else
- {
- ULONG n = ::PrfQueryProfileString( HINI_PROFILE
- ,(PSZ)WXSTRINGCAST section
- ,(PSZ)WXSTRINGCAST entry
- ,(PSZ)defunkt
- ,(void*)wxBuffer
- ,1000
- );
- if (n == 0L || wxStrcmp(wxBuffer, defunkt) == 0)
- return FALSE;
- }
- if (*value)
- delete[] (*value);
- *value = copystring(wxBuffer);
- return TRUE;
-}
-
-bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file)
-{
- wxChar *s = NULL;
- bool succ = wxGetResource(section, entry, (wxChar **)&s, file);
- if (succ)
- {
- *value = (float)wxStrtod(s, NULL);
- delete[] s;
- return TRUE;
- }
- else return FALSE;
+// Non-fatal error: pop up message box and (possibly) continue
+void wxError(
+ const wxString& rMsg
+, const wxString& rTitle
+)
+{
+ wxBuffer = new wxChar[256];
+ wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg);
+ if (::WinMessageBox( HWND_DESKTOP
+ ,NULL
+ ,(PSZ)wxBuffer
+ ,(PSZ)WXSTRINGCAST rTitle
+ ,0
+ ,MB_ICONEXCLAMATION | MB_YESNO
+ ) == MBID_YES)
+ delete[] wxBuffer;
+ wxExit();