abdul
Aug 31st, 2001, 08:24 PM
I am using "ShellExecute" to open a file but I want to show an error message whenever the path or file is invalid or some other error occurs. How do I do that?
I have tried the following line of code but even if the specific path is valid, it still shows the error message:
if(ShellExecute(hwnd, "open",combotext,NULL,NULL, SW_NORMAL)==(HINSTANCE)ERROR_FILE_NOT_FOUND || (HINSTANCE)ERROR_PATH_NOT_FOUND || (HINSTANCE)ERROR_PATH_NOT_FOUND)
{
MessageBox(hwnd, "The specified file name or path was not found, or there is not enough memory to run this program. Please try again"
, "Error!!", MB_OK | MB_ICONERROR);
}
When I type "C:\" as the path, it opened The contents of C: but still showed me the message box. How do you fix that?
I have tried the following line of code but even if the specific path is valid, it still shows the error message:
if(ShellExecute(hwnd, "open",combotext,NULL,NULL, SW_NORMAL)==(HINSTANCE)ERROR_FILE_NOT_FOUND || (HINSTANCE)ERROR_PATH_NOT_FOUND || (HINSTANCE)ERROR_PATH_NOT_FOUND)
{
MessageBox(hwnd, "The specified file name or path was not found, or there is not enough memory to run this program. Please try again"
, "Error!!", MB_OK | MB_ICONERROR);
}
When I type "C:\" as the path, it opened The contents of C: but still showed me the message box. How do you fix that?