|
-
April 13th, 2010, 11:40 AM
#1
ShellExecute problem
In the following code the first ShellExecute statement does not work even though even though strAppDirectory contains the same path as the next ShellExecute statement that does work.
Do I have a dumb mistake that I am missing?
void CDBcalcDlg::OnHelp()
{
char szAppPath[MAX_PATH] = "";
CString strAppDirectory;
::GetModuleFileName(0, szAppPath, sizeof(szAppPath) - 1);
// Extract directory
strAppDirectory = szAppPath;
strAppDirectory = strAppDirectory.Left(strAppDirectory.ReverseFind('\\'));
ShellExecute(hWnd, _T("open"), _T("C:\\strAppDirectory\\dBcalc.chm"),NULL, NULL, SW_SHOWNORMAL);
ShellExecute(hWnd, _T("open"), _T("C:\\Users\\Clay\\Documents\\Visual Studio 2005\\Projects\\Chm_dBcalc\\dBcalc\\Debug\\dBcalc.chm"),NULL, NULL, SW_SHOWNORMAL);
}
Last edited by Clay L; April 13th, 2010 at 02:56 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|