Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

ShellExecute problem


  • Please log in to reply

#1
Clay L

Clay L

    New Member

  • Member
  • Pip
  • 4 posts
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);


}
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP