Click here to Skip to main content
15,890,186 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WaitForMultipleObjects not waiting Pin
Joe Woodbury9-Jun-08 12:29
professionalJoe Woodbury9-Jun-08 12:29 
GeneralRe: WaitForMultipleObjects not waiting Pin
wjeanveau9-Jun-08 12:43
wjeanveau9-Jun-08 12:43 
GeneralRe: WaitForMultipleObjects not waiting Pin
Joe Woodbury9-Jun-08 12:59
professionalJoe Woodbury9-Jun-08 12:59 
GeneralRe: WaitForMultipleObjects not waiting Pin
wjeanveau9-Jun-08 13:10
wjeanveau9-Jun-08 13:10 
GeneralRe: WaitForMultipleObjects not waiting Pin
Joe Woodbury9-Jun-08 13:17
professionalJoe Woodbury9-Jun-08 13:17 
GeneralRe: WaitForMultipleObjects not waiting Pin
wjeanveau9-Jun-08 13:23
wjeanveau9-Jun-08 13:23 
GeneralRe: WaitForMultipleObjects not waiting Pin
Joe Woodbury9-Jun-08 13:42
professionalJoe Woodbury9-Jun-08 13:42 
GeneralRe: WaitForMultipleObjects not waiting Pin
wjeanveau9-Jun-08 14:36
wjeanveau9-Jun-08 14:36 
I added in the if(i==progList.size()-1) to ensure I caught the last group that ran through since it would never see the else code. I have moved all the timer sutff and put it into the else block now. This clears up my timer problem. Essentially what I am looking at now is making the PROCESS_INFORMATION into a dynamic array so I can store all the pi information for later. Then I run this

CreateProcessA(NULL, commandLine, NULL, NULL, false, 0, NULL, NULL, &;sinfo, &;pi[i]);

and put it into the vector of handles for later.

vecHandles.push_back(pi[i].hProcess);

It loops here for a while, when the groupNumber changes is now goes to the else block and executes

I made another dynamic array, but this time it is an array of handles the size of (i) called myThreads

WaitForMultipleObjects(n, myThreads, TRUE ,INFINITE);
DWORD exitCode = 0;
GetExitCodeProcess(pi[i].hProcess, &exitCode);

Put the timing stuff here
The timing now works fine

Now I have to concentrate on getting this done:

ProgramDetails finDetails(currGroup, str1, str2, exitCode, kTime, uTime);
finishedList.push_back(finDetails);
Now close the handles
CloseHandle(pi[i].hThread);
CloseHandle(pi[i].hProcess);

The problem I am now facing is how to put the currGroup, str1, and str2 from each process into the final vector along with the timing information and exit code.

Have I confused things enough now? This has been a slow painful process.
GeneralRe: WaitForMultipleObjects not waiting Pin
Joe Woodbury9-Jun-08 15:31
professionalJoe Woodbury9-Jun-08 15:31 
GeneralRe: WaitForMultipleObjects not waiting Pin
wjeanveau9-Jun-08 17:10
wjeanveau9-Jun-08 17:10 
Questionreading bits from file Pin
botnet9-Jun-08 11:06
botnet9-Jun-08 11:06 
AnswerRe: reading bits from file Pin
Jijo.Raj9-Jun-08 18:38
Jijo.Raj9-Jun-08 18:38 
GeneralRe: reading bits from file Pin
achainard10-Jun-08 2:45
achainard10-Jun-08 2:45 
GeneralRe: reading bits from file Pin
botnet10-Jun-08 13:09
botnet10-Jun-08 13:09 
AnswerRe: reading bits from file Pin
krmed10-Jun-08 6:08
krmed10-Jun-08 6:08 
QuestionBlank printout to printer Pin
Joe Smith IX9-Jun-08 7:04
Joe Smith IX9-Jun-08 7:04 
AnswerRe: Blank printout to printer [modified] Pin
Nelek9-Jun-08 8:12
protectorNelek9-Jun-08 8:12 
GeneralRe: Blank printout to printer Pin
Joe Smith IX9-Jun-08 8:33
Joe Smith IX9-Jun-08 8:33 
GeneralRe: Blank printout to printer Pin
Nelek9-Jun-08 8:59
protectorNelek9-Jun-08 8:59 
GeneralRe: Blank printout to printer Pin
Joe Smith IX9-Jun-08 9:22
Joe Smith IX9-Jun-08 9:22 
GeneralRe: Blank printout to printer Pin
Nelek9-Jun-08 9:34
protectorNelek9-Jun-08 9:34 
GeneralRe: Blank printout to printer Pin
Joe Smith IX9-Jun-08 9:53
Joe Smith IX9-Jun-08 9:53 
GeneralRe: Blank printout to printer Pin
Nelek9-Jun-08 10:02
protectorNelek9-Jun-08 10:02 
GeneralRe: Blank printout to printer Pin
Joe Smith IX9-Jun-08 10:18
Joe Smith IX9-Jun-08 10:18 
GeneralRe: Blank printout to printer Pin
Nelek9-Jun-08 10:32
protectorNelek9-Jun-08 10:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.