Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralR6017 Unexpected Multi-Thread Lock Pin
parnelltk5-Dec-02 9:59
parnelltk5-Dec-02 9:59 
GeneralRe: R6017 Unexpected Multi-Thread Lock Pin
PJ Arends5-Dec-02 11:11
professionalPJ Arends5-Dec-02 11:11 
GeneralRe: R6017 Unexpected Multi-Thread Lock Pin
parnelltk5-Dec-02 11:56
parnelltk5-Dec-02 11:56 
GeneralRe: R6017 Unexpected Multi-Thread Lock Pin
PJ Arends5-Dec-02 15:42
professionalPJ Arends5-Dec-02 15:42 
Generalkeeping iterator in position Pin
Member 1043935-Dec-02 9:52
Member 1043935-Dec-02 9:52 
GeneralNeed HELP! MSXML! Pin
Daniel Strigl5-Dec-02 9:48
Daniel Strigl5-Dec-02 9:48 
GeneralCWinThread Question... Pin
RobJones5-Dec-02 9:42
RobJones5-Dec-02 9:42 
GeneralRe: CWinThread Question... Pin
Dave Bryant5-Dec-02 11:06
Dave Bryant5-Dec-02 11:06 
OnIdle() gets called until the return value tells the framework not to call it anymore.

Anyway, you can create a timer using the API function SetTimer(), passing the HWND parameter as NULL so that the timer message is then sent to the thread instead of a window. You can then pick up the WM_TIMER message in the PreTranslateMessage() method of the CWinThread derived class.

e.g.

BOOL CThread::InitInstance()
{
// Every second
m_nID = ::SetTimer( NULL, 0, 1000, NULL );
ASSERT( m_nID != 0 );

return TRUE;
}

BOOL CThread::PreTranslateMessage(MSG* pMsg)
{
if ( WM_TIMER == pMsg->message && m_nID == pMsg->wParam )
{
::KillTimer( m_nID );
PostQuitMessage( 0 ); // Kill the thread
return TRUE; // We have finished processing this message
}

return CWinThread::PreTranslateMessage( pMsg );
}

Dave
GeneralRe: CWinThread Question... Pin
RobJones5-Dec-02 11:09
RobJones5-Dec-02 11:09 
GeneralCallbackfunction question Pin
russell thorburn5-Dec-02 8:38
sussrussell thorburn5-Dec-02 8:38 
GeneralRe: Callbackfunction question Pin
Dave Bryant5-Dec-02 8:52
Dave Bryant5-Dec-02 8:52 
GeneralRe: Callbackfunction question Pin
russell thorburn5-Dec-02 11:03
sussrussell thorburn5-Dec-02 11:03 
GeneralCTabCtrl - Should be an easy one Pin
Dave_5-Dec-02 7:37
Dave_5-Dec-02 7:37 
GeneralRe: CTabCtrl - Should be an easy one Pin
Shog95-Dec-02 17:55
sitebuilderShog95-Dec-02 17:55 
Generaltoolbar position problems Pin
MichaT5-Dec-02 6:58
MichaT5-Dec-02 6:58 
GeneralRe: toolbar position problems Pin
Roger Allen5-Dec-02 7:55
Roger Allen5-Dec-02 7:55 
GeneralRe: toolbar position problems Pin
MichaT5-Dec-02 8:06
MichaT5-Dec-02 8:06 
GeneralCFont problem... Pin
Ruca5-Dec-02 6:23
Ruca5-Dec-02 6:23 
GeneralRe: CFont problem... Pin
Michael Dunn5-Dec-02 6:32
sitebuilderMichael Dunn5-Dec-02 6:32 
GeneralRe: CFont problem... Pin
Ruca5-Dec-02 6:48
Ruca5-Dec-02 6:48 
GeneralCHttpFile Pin
Paul M Watt5-Dec-02 6:01
mentorPaul M Watt5-Dec-02 6:01 
GeneralRe: CHttpFile Pin
sonshiro5-Dec-02 18:23
sonshiro5-Dec-02 18:23 
GeneralProbable Memory Leak Pin
Tili5-Dec-02 5:22
Tili5-Dec-02 5:22 
QuestionWhat is the difference between ... Pin
User 98855-Dec-02 5:14
User 98855-Dec-02 5:14 
AnswerRe: What is the difference between ... Pin
Maximilien5-Dec-02 5:24
Maximilien5-Dec-02 5:24 

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.