How to supply user's information inside the CreateProcess function? Below is my current work. It seems cannot call my 开发者_如何学Cexternal exe. But when I run it manually inside console, it runs well.
if (CreateProcess(parameterA.GetBuffer(), parameterB.GetBuffer(),0,0,TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&sInfo,&pInfo))
{
WaitForSingleObject (pInfo.hProcess, INFINITE);
}
parameterA = "myapp.exe"; parameterB = " -i";
The first argument may be null - you specify the process path in the second argument only. Please show us what parameterB
is. You also need to to initialize STARTUPINFO properly.
精彩评论