I need to start up to 4 instances of an application from another application. But can have 1 and 4 running only or 1, 2 and 4 running (i.e. not 3).
How do you pass a number to allow the application starting up to know which instance to be.
Currently if a start 1 and 3 then 1 and 2 run as 2 knows that 1 is running so takes the next number available; it needs to be told to be 3.
I use the following to start the applications: (Check box for each one)
if(g_pIDU1->GetCheck ()) // Check box 1 set?
{
GetStartupInfo(&si[0]);
CreateProcess(NULL, "c:\\IDU_Emu\\debug\\IDU_Emu.exe", // Name of app to launch
NULL, // Default process security attributes
NULL, // Default thread security attributes
FALSE, // Don't inherit handles from the parent
0, // Normal priority
NULL, // Use the same environment as the parent
NULL, // Launch in the current directory
&si[0], // Startup Information
&pi[0]); // Process information stored upon return CW_USEDEFAULT
}
etc
How do you pass a number to allow the application starting up to know which instance to be.
Currently if a start 1 and 3 then 1 and 2 run as 2 knows that 1 is running so takes the next number available; it needs to be told to be 3.
I use the following to start the applications: (Check box for each one)
if(g_pIDU1->GetCheck ()) // Check box 1 set?
{
GetStartupInfo(&si[0]);
CreateProcess(NULL, "c:\\IDU_Emu\\debug\\IDU_Emu.exe", // Name of app to launch
NULL, // Default process security attributes
NULL, // Default thread security attributes
FALSE, // Don't inherit handles from the parent
0, // Normal priority
NULL, // Use the same environment as the parent
NULL, // Launch in the current directory
&si[0], // Startup Information
&pi[0]); // Process information stored upon return CW_USEDEFAULT
}
etc