Tweak error reporting

This commit is contained in:
Andy McFadden 2014-12-17 15:45:28 -08:00
parent 7b70767a1f
commit 13c38be4aa
3 changed files with 20 additions and 9 deletions

View File

@ -90,12 +90,7 @@ void ExtractOptionsDialog::DoDataExchange(CDataExchange* pDX)
if (pDX->m_bSaveAndValidate) { if (pDX->m_bSaveAndValidate) {
if (!fIncludeDataForks && !fIncludeRsrcForks && !fIncludeDiskImages) { if (!fIncludeDataForks && !fIncludeRsrcForks && !fIncludeDiskImages) {
CString appName, errMsg; ShowFailureMsg(this, IDS_NO_FORKS_SPECIFIED, IDS_MB_APP_NAME);
CheckedLoadString(&appName, IDS_MB_APP_NAME);
CheckedLoadString(&errMsg, IDS_NO_FORKS_SPECIFIED);
MessageBox(errMsg, appName, MB_OK);
pDX->Fail(); pDX->Fail();
return; return;
} }

View File

@ -388,12 +388,22 @@ void GetWin32ErrorString(DWORD err, CString* pStr)
void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID) void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID)
{ {
CString failed; CString title;
CheckedLoadString(&failed, titleStrID); CheckedLoadString(&title, titleStrID);
pWnd->MessageBox(msg, failed, MB_OK | MB_ICONERROR); pWnd->MessageBox(msg, title, MB_OK | MB_ICONERROR);
} }
void ShowFailureMsg(CWnd* pWnd, int msgId, int titleStrID)
{
CString msg, title;
CheckedLoadString(&title, titleStrID);
CheckedLoadString(&msg, msgId);
pWnd->MessageBox(msg, title, MB_OK | MB_ICONERROR);
}
bool IsWin9x(void) bool IsWin9x(void)
{ {
OSVERSIONINFO osvers; OSVERSIONINFO osvers;

View File

@ -181,6 +181,12 @@ void GetWin32ErrorString(DWORD err, CString* pStr);
*/ */
void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID); void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID);
/*
* Post a failure message in a message box.
*/
void ShowFailureMsg(CWnd* pWnd, int msgId, int titleStrID);
/* /*
* Returns "true" if we're running on Win9x (Win95, Win98, WinME), "false" * Returns "true" if we're running on Win9x (Win95, Win98, WinME), "false"
* if not (could be WinNT/2K/XP or even Win31 with Win32s). * if not (could be WinNT/2K/XP or even Win31 with Win32s).