Jun 8, 2014 at 3:30pm
Hello,
I have the following code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
SHELLEXECUTEINFO ExecuteInfo;
memset(&ExecuteInfo, 0, sizeof(ExecuteInfo)); // Reseting ExecuteInfo
ExecuteInfo.cbSize = sizeof(ExecuteInfo); // Size
ExecuteInfo.fMask = NULL;
ExecuteInfo.hwnd = NULL;
ExecuteInfo.lpVerb = "open"; // Operation to perform
ExecuteInfo.lpFile = "D:\\ffmpeg"; // Application name
ExecuteInfo.lpParameters = ConvertCall.c_str(); // Additional parameters
ExecuteInfo.lpDirectory = NULL; // Default directory
ExecuteInfo.nShow = SW_HIDE; // Hide the ShellExecute
ExecuteInfo.hInstApp = 0;
ShellExecuteEx(&ExecuteInfo);
DWORD s = WaitForSingleObject(ExecuteInfo.hProcess,INFINITE);
|
My problem is, WaitForSingleObject allways fails... (s is getting the value of 4294967295 which means it failed)
I have called GetLastError, and I am getting the error of : "Handle is invalid" Why so ?
Why does it allways fail ? I need the program to wait untill ShellExecuteEx finishes completely.
Thanks!
Last edited on Jun 8, 2014 at 3:36pm