CString defPath = GetModulePath();
// Don't add quotation marks yet, CFile doesn't like them
CString docPath = defPath + _T("\\Docs\\Contributors.rtf");
+ HINSTANCE ret = 0;
CFileStatus status;
if (CFile::GetStatus(docPath, status))
// includes spaces
docPath.Insert(0, _T("\""));
docPath.Insert(docPath.GetLength(), _T("\""));
- ShellExecute(m_hWnd, NULL, _T("wordpad"), docPath, defPath, SW_SHOWNORMAL);
+ ret = ShellExecute(m_hWnd, NULL, _T("wordpad"), docPath, defPath, SW_SHOWNORMAL);
+
+ // values < 32 are errors (ref to MSDN)
+ if ((int)ret < 32)
+ {
+ // Try to open with ssociated application (.rtf)
+ ret = ShellExecute(m_hWnd, _T("open"), docPath, NULL, NULL, SW_SHOWNORMAL);
+ if ((int)ret < 32)
+ {
+ CString msg;
+ AfxFormatString1(msg, IDS_CANNOT_EXECUTE_FILE, _T("WordPad.exe"));
+ AfxMessageBox(msg, MB_OK | MB_ICONSTOP);
+ }
+ }
}
else
{
Src/res new files: change_pane.bmp go_to.bmp language.bmp replace.bmp select_font.bmp
Languages: *.rc resource.h
Languages/res new files: change_pane.bmp go_to.bmp language.bmp replace.bmp select_font.bmp
+ PATCH: [ 915790 ] Open Contributors.rtf from About dialog
+ Handle errors if wordpad or associated app couldn't be run.
+ Src: Merge.cpp
2004-03-16 Seier
Installer [Patch 917142]: