Im using this code to start my program
int _tmain(int argc, _TCHAR* argv[])
{
STARTUPINFO cif;
ZeroMemory(&cif,sizeof(STARTUPINFO));
PROCESS_INFORMATION pi;
if (CreateProcess(L"C:\\test\\test.exe",NULL,
NULL,NULL,FALSE,CREATE_UNICODE_ENVIRONMENT,NULL,NULL,&cif,&pi)==TRUE)
{
cout << "process" << endl;
cout << "handle " << pi.hProcess << endl;
}
system("pause");
return 0;
}
The program starts normal, but immediately fails(not responding and fails). CreateProcess returns true. When I start test.exe not from code it works properly.
test.exe? - Adam Rosenfield0for process creation flag (instead ofCREATE_UNICODE_ENVIRONMENT)? You're passingCREATE_UNICODE_ENVIRONMENTas this flag andNULLfor environment block but are you sure that environment block of the calling process useUNICODEcharacters? - Bojan Komazec