Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 19:02
Stephen Hewitt26-Apr-07 19:02 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
GameProfessor26-Apr-07 21:01
GameProfessor26-Apr-07 21:01 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
kasturi_haribabu26-Apr-07 21:22
kasturi_haribabu26-Apr-07 21:22 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 21:26
Stephen Hewitt26-Apr-07 21:26 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
GameProfessor26-Apr-07 21:26
GameProfessor26-Apr-07 21:26 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 21:34
Stephen Hewitt26-Apr-07 21:34 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 21:25
Stephen Hewitt26-Apr-07 21:25 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
GameProfessor26-Apr-07 21:45
GameProfessor26-Apr-07 21:45 
this doesn't work because things in OnIdle() can not be a loop and the framework doesn't loop that function by itself. I need an infinite loop. I have try these two methods:

Method 1: --> my thread can not handle any message from main thread
BOOL CMyThread::OnIdle(LONG lCount)
{
for(;;)
{
DoMyWork();
}
CWinThread::OnIdle(lCount);
return TRUE;
}
Method 2: --> DoMyWork() only run one time after we send message from Main thread to My thread.
BOOL CMyThread::OnIdle(LONG lCount)
{
DoMyWork();
CWinThread::OnIdle(lCount);
return TRUE;
}

I expect DoMyWork() to be loop to run forever !!! There must be a way, isn't it?
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 21:48
Stephen Hewitt26-Apr-07 21:48 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
GameProfessor26-Apr-07 21:52
GameProfessor26-Apr-07 21:52 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt26-Apr-07 22:12
Stephen Hewitt26-Apr-07 22:12 
GeneralRe: UI-thread with both message pump and an infinite loop Pin
Stephen Hewitt27-Apr-07 0:20
Stephen Hewitt27-Apr-07 0:20 
QuestionFile with permission Pin
vivekphlp26-Apr-07 18:26
vivekphlp26-Apr-07 18:26 
AnswerRe: File with permission Pin
Paresh Chitte26-Apr-07 18:40
Paresh Chitte26-Apr-07 18:40 
GeneralRe: File with permission Pin
vivekphlp26-Apr-07 18:46
vivekphlp26-Apr-07 18:46 
GeneralRe: File with permission Pin
Paresh Chitte26-Apr-07 20:13
Paresh Chitte26-Apr-07 20:13 
GeneralRe: File with permission Pin
Paresh Chitte26-Apr-07 20:22
Paresh Chitte26-Apr-07 20:22 
AnswerRe: File with permission Pin
uday kiran janaswamy26-Apr-07 19:32
uday kiran janaswamy26-Apr-07 19:32 
AnswerRe: File with permission Pin
skornel27-Apr-07 4:41
skornel27-Apr-07 4:41 
GeneralRe: File with permission Pin
vivekphlp27-Apr-07 17:40
vivekphlp27-Apr-07 17:40 
QuestionEmai Processing System Pin
xinxin062926-Apr-07 16:51
xinxin062926-Apr-07 16:51 
QuestionFile name to video buffer Pin
hmaturana26-Apr-07 16:34
hmaturana26-Apr-07 16:34 
QuestionRe: File name to video buffer Pin
Mark Salsbery29-Apr-07 10:06
Mark Salsbery29-Apr-07 10:06 
AnswerRe: File name to video buffer Pin
hmaturana30-Apr-07 13:28
hmaturana30-Apr-07 13:28 
GeneralRe: File name to video buffer [modified] Pin
Mark Salsbery1-May-07 5:21
Mark Salsbery1-May-07 5:21 

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.