Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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