Click here to Skip to main content
15,904,346 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to replace a CDC of another CWnd Pin
FlyingBear2-Aug-07 8:53
FlyingBear2-Aug-07 8:53 
AnswerRe: How to replace a CDC of another CWnd Pin
FlyingBear2-Aug-07 19:21
FlyingBear2-Aug-07 19:21 
QuestionEnable C++ Exceptions Pin
Tal S.1-Aug-07 22:37
Tal S.1-Aug-07 22:37 
AnswerRe: Enable C++ Exceptions Pin
Russell'2-Aug-07 2:35
Russell'2-Aug-07 2:35 
QuestionRunning 10 threads at a time Pin
neha.agarwal271-Aug-07 22:22
neha.agarwal271-Aug-07 22:22 
AnswerRe: Running 10 threads at a time Pin
Iain Clarke, Warrior Programmer1-Aug-07 22:48
Iain Clarke, Warrior Programmer1-Aug-07 22:48 
AnswerRe: Running 10 threads at a time Pin
Iain Clarke, Warrior Programmer1-Aug-07 22:52
Iain Clarke, Warrior Programmer1-Aug-07 22:52 
AnswerRe: Running 10 threads at a time Pin
Russell'1-Aug-07 22:57
Russell'1-Aug-07 22:57 
You can use a variable to count the threads

Global declaration:
<code>volatile </code>UINT RunningThread;   //Create the counter


The main function:
foo(){
RunningThread=0;   //Reset the counter
for(i=0;i<200;i++){
   if(RunningThread<10){
      //Create Thread
      RunningThread++;   //Incremente the counter
   }else{
      wait(100);
      i--;
      continue;
   }
}
}


The thread:
Thread(...){
//Work process
RunningThread--;  // Before it ends decrement the counter
}



Russell

GeneralRe: Running 10 threads at a time Pin
neha.agarwal272-Aug-07 2:09
neha.agarwal272-Aug-07 2:09 
GeneralRe: Running 10 threads at a time Pin
Russell'2-Aug-07 2:27
Russell'2-Aug-07 2:27 
GeneralRe: Running 10 threads at a time Pin
Mark Salsbery2-Aug-07 8:31
Mark Salsbery2-Aug-07 8:31 
QuestionWM_INITDIALOG in VS 2005 Pin
vipin_nvk1-Aug-07 22:20
vipin_nvk1-Aug-07 22:20 
AnswerRe: WM_INITDIALOG in VS 2005 Pin
Anurag Gandhi1-Aug-07 22:51
professionalAnurag Gandhi1-Aug-07 22:51 
AnswerRe: WM_INITDIALOG in VS 2005 Pin
KarstenK1-Aug-07 23:49
mveKarstenK1-Aug-07 23:49 
QuestionHow can i get Partition name from partition number? Pin
Banks K1-Aug-07 22:03
Banks K1-Aug-07 22:03 
AnswerRe: How can i get Partition name from partition number? Pin
Naveen1-Aug-07 23:48
Naveen1-Aug-07 23:48 
QuestionInterrupts in windows Pin
zon_cpp1-Aug-07 21:35
zon_cpp1-Aug-07 21:35 
AnswerRe: Interrupts in windows Pin
Hamid_RT1-Aug-07 21:40
Hamid_RT1-Aug-07 21:40 
Questionhow can i control the sound of left and right speaker Pin
rajneshmalik1-Aug-07 21:11
rajneshmalik1-Aug-07 21:11 
AnswerRe: how can i control the sound of left and right speaker Pin
Hamid_RT1-Aug-07 21:37
Hamid_RT1-Aug-07 21:37 
QuestionAvoid using .ini files Pin
vipin_nvk1-Aug-07 20:56
vipin_nvk1-Aug-07 20:56 
AnswerRe: Avoid using .ini files Pin
Peter Weyzen1-Aug-07 21:03
Peter Weyzen1-Aug-07 21:03 
AnswerRe: Avoid using .ini files Pin
CPallini1-Aug-07 21:06
mveCPallini1-Aug-07 21:06 
AnswerRe: Avoid using .ini files Pin
Hamid_RT1-Aug-07 21:23
Hamid_RT1-Aug-07 21:23 
AnswerRe: Avoid using .ini files Pin
toxcct1-Aug-07 22:15
toxcct1-Aug-07 22:15 

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.