From 51539691a587abd6036d3bad16c2c9d5bd697837 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Wed, 17 Mar 2004 16:05:11 +0000 Subject: [PATCH] PATCH: [ 915790 ] Open Contributors.rtf from About dialog - handle more errors --- Src/Merge.cpp | 16 +++++++++++++++- Src/readme.txt | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Src/Merge.cpp b/Src/Merge.cpp index 0f05652d7..a145f02e9 100644 --- a/Src/Merge.cpp +++ b/Src/Merge.cpp @@ -737,6 +737,7 @@ void CAboutDlg::OnBnClickedOpenContributors() 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)) @@ -745,7 +746,20 @@ void CAboutDlg::OnBnClickedOpenContributors() // 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 { diff --git a/Src/readme.txt b/Src/readme.txt index ae1a57354..786bbeab9 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -5,6 +5,9 @@ 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]: -- 2.11.0