Est-il possible de transmettre un chemin relatif pour créer mon processus fils? Ce code va compiler, mais il donne une erreur car j'utilise un chemin relatif.en utilisant CreateProcess avec un chemin relatif
void Cminivideo3App::creerChildProcess(void)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
// Start the child process.
int retvalue = CreateProcess(TEXT("\..\Debug\traitement.exe"), // No module name (use command line)
NULL, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi // Pointer to PROCESS_INFORMATION structure
);
int lastError = GetLastError();
}
Pour une raison quelconque aujourd'hui, cela a fonctionné. J'avais abandonné les processus fils et j'utilisais Visual Studio pour démarrer les deux projets. Merci beaucoup! – toto