{
// Don't know how to invoke external editor (it doesn't end with
// an obvious executable extension)
- CString msg;
- AfxFormatString1(msg, IDS_CANNOT_EXECUTE_FILE, sExtEditor);
- AfxMessageBox(msg, MB_ICONSTOP);
+ ResMsgBox1(IDS_CANNOT_EXECUTE_FILE, sExtEditor, MB_ICONSTOP);
}
return TRUE;
}
pathAbsolute = paths_IsPathAbsolute(m_fileResult);
if (pathAbsolute == FALSE)
{
- CString msg;
- AfxFormatString1(msg, IDS_PATH_NOT_ABSOLUTE, m_fileResult);
- AfxMessageBox(msg, MB_ICONSTOP);
+ ResMsgBox1(IDS_PATH_NOT_ABSOLUTE, m_fileResult, MB_ICONSTOP);
}
}
return s;
}
+// Combines AfxFormatString1 with AfxMessageBox
+int
+ResMsgBox1(int msgid, LPCTSTR arg, UINT nType, UINT nIDHelp)
+{
+ CString msg;
+ AfxFormatString1(msg, msgid, arg);
+ if (!nIDHelp) nIDHelp = msgid;
+ return AfxMessageBox(msg, nType, nIDHelp);
+}
+
// Get user language description of error, if available
CString GetSysError(int nerr)
{
/** @brief Load string from string resources; shortcut for CString::LoadString */
CString LoadResString(int id);
+ /** @brief Format single-argument resource string and display via AfxMessageBox */
+int ResMsgBox1(int msgid, LPCTSTR arg, UINT nType = MB_OK, UINT nIDHelp = 0);
+
/** @brief Retrieve error description from Windows; uses FormatMessage */
CString GetSysError(int nerr);
+2005-05-09 Perry
+ PATCH: [ 1197727 ] New method ResMsgBox1 to simplify cookie-cutter code
+ Src: MainFrm.cpp PatchDlg.cpp StdAfx.cpp StdAfx.h
+
2005-05-08 Kimmo
PATCH: [ 1196889 ] Move options initializations to own file
Src: MainFrm.cpp Merge.dsp