Click here to Skip to main content
15,911,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to access the files Pin
Naveen12-Sep-06 21:39
Naveen12-Sep-06 21:39 
GeneralRe: How to access the files Pin
radhika2812-Sep-06 21:44
radhika2812-Sep-06 21:44 
GeneralRe: How to access the files Pin
Hamid_RT12-Sep-06 22:08
Hamid_RT12-Sep-06 22:08 
QuestionPreTranslateMessage(), OnCancel() Pin
kumar_mk12-Sep-06 20:49
kumar_mk12-Sep-06 20:49 
AnswerRe: PreTranslateMessage(), OnCancel() Pin
Mr.Brainley12-Sep-06 21:02
Mr.Brainley12-Sep-06 21:02 
AnswerRe: PreTranslateMessage(), OnCancel() Pin
Naveen12-Sep-06 21:29
Naveen12-Sep-06 21:29 
GeneralRe: PreTranslateMessage(), OnCancel() Pin
kumar_mk12-Sep-06 23:12
kumar_mk12-Sep-06 23:12 
QuestionThreads sleep Pin
tiflo12-Sep-06 20:40
tiflo12-Sep-06 20:40 
Hello,
ich have a question to threads and the function sleep.

We have a main programm and load from this a dll as a thread with AfxThreadStart and it is stopped with AfxThreadStop.
The dll has a method run in which is a loop which proofs a condition and runs as long as this condition is true. to stop this thread i set the condition to false. after the loop has stopped another boolean ist set to false so i know that the thread is stopped and i can delete everey references an stop the whole programm.

the pseudo code of the dll

start() {
afxThreadStart(this, true);
}

stop (){
running = false;
}

run() {
stopped = false;
while(running) {
do something
}
stopped = true;
AfxStopThread();
}
isStopped() {
return stopped;
}

I have a gui and a button, if i hit the button, the thread should be stopped and i wait until it has stopped, so i can delete all refereces to some other objects.

pseudocode for the main prog

hitButton() {
dllThread->stop();
while(!dllThread->isStopped()) {
sleep(1000);
}
delete references;
...
}

The main Problem is, that if i use the slepp method in the main Programm (see code for main prog.), it seems that the dll-thread sleeps too.

thanks for your help
Timo

AnswerRe: Threads sleep Pin
HelloGuysHelpMe12-Sep-06 20:59
HelloGuysHelpMe12-Sep-06 20:59 
GeneralRe: Threads sleep Pin
tiflo13-Sep-06 1:14
tiflo13-Sep-06 1:14 
GeneralRe: Threads sleep Pin
Steve S13-Sep-06 1:38
Steve S13-Sep-06 1:38 
GeneralRe: Threads sleep Pin
tiflo13-Sep-06 5:55
tiflo13-Sep-06 5:55 
Questionhow to get control when right-mouse or middle-mouse click on button??? Pin
michaelleetw12-Sep-06 20:00
michaelleetw12-Sep-06 20:00 
AnswerRe: how to get control when right-mouse or middle-mouse click on button??? Pin
Programm3r12-Sep-06 20:07
Programm3r12-Sep-06 20:07 
AnswerRe: how to get control when right-mouse or middle-mouse click on button??? Pin
Hamid_RT12-Sep-06 22:06
Hamid_RT12-Sep-06 22:06 
AnswerRe: how to get control when right-mouse or middle-mouse click on button??? Pin
Nibu babu thomas12-Sep-06 23:05
Nibu babu thomas12-Sep-06 23:05 
Questionreading data from Base address of a device Pin
vijay_aroli12-Sep-06 19:33
vijay_aroli12-Sep-06 19:33 
AnswerRe: reading data from Base address of a device Pin
Cedric Moonen12-Sep-06 20:43
Cedric Moonen12-Sep-06 20:43 
GeneralRe: reading data from Base address of a device Pin
vijay_aroli12-Sep-06 21:17
vijay_aroli12-Sep-06 21:17 
GeneralRe: reading data from Base address of a device Pin
Steve S13-Sep-06 1:43
Steve S13-Sep-06 1:43 
Questionhow can i get total path of a particular file inserted in a List control. Pin
kiranin12-Sep-06 19:03
kiranin12-Sep-06 19:03 
AnswerRe: how can i get total path of a particular file inserted in a List control. Pin
Christian Graus12-Sep-06 19:09
protectorChristian Graus12-Sep-06 19:09 
AnswerRe: how can i get total path of a particular file inserted in a List control. Pin
Hamid_RT12-Sep-06 22:18
Hamid_RT12-Sep-06 22:18 
QuestionOcx to exe Pin
Rinu_Raj12-Sep-06 19:02
Rinu_Raj12-Sep-06 19:02 
AnswerRe: Ocx to exe Pin
toxcct12-Sep-06 21:29
toxcct12-Sep-06 21:29 

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.