1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
std::ostringstream cmdLineString("");
cmdLineString << " -o " << "test.luc" << " " << "test.lua";
PROCESS_INFORMATION Process;
STARTUPINFO StartInfo;
memset(&StartInfo, 0, sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
char strtmp[250];
strcpy(strtmp, cmdLineString.str().c_str());
if(!CreateProcess("LuaC.exe", strtmp, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartInfo, &Process))
{
Application->MessageBox("cannot launch process", "Error", MB_OK);
}
// Attend la fin du programme
WaitForSingleObject(Process.hProcess, INFINITE); |