SHELLEXECUTEINFO sei , access denied - to startup parsm(file)
vc++ studio 2005
I'm using SHELLEXECUTEINFO as I have for years, I'm now getting an error
from the called app "Access to (requested path) was denied";
I've spent way too much time on this now, can one of you kindly gurus help
me out?
The only differance on my machine is that I recently installe "SQL Manager
Express" is that the reason or is there something in my calling method?
this is it.
//---------------------------
Test.exe just takes a directory/path as an arg. and does some stuff!
SHELLEXECUTEINFO sei;
ZeroMemory( &sei, sizeof(sei) );
sei.cbSize = sizeof(sei);
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.hwnd = NULL;
sei.lpVerb = "open";
sei.lpFile = _T("C:\\Test.exe");
sei.lpParameters = _T("C:\\Temp");
sei.lpDirectory = _T("C:\\Temp");
sei.nShow = SW_SHOWNORMAL;
//HINSTANCE hInstApp; will fill
// Optional members
sei.lpIDList = NULL;
sei.lpClass = NULL;
sei.hkeyClass = NULL;
sei.dwHotKey = NULL;
sei.hIcon = NULL;
//HANDLE sei.hProcess; will fill
TRY
{
ShellExecuteEx(&sei);
}
CATCH( CFileException, e )
{
CString strError;
strError.Format("%d", e->m_cause);
CString msg = _T("Could not open application\nError code ");
msg += strError;
AfxMessageBox(msg);
}
END_CATCH
//WaitForSingleObject( sei.hProcess, INFINITE );
Thanks