Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat is wrong with this class - C2248 error Pin
charlieg7-Jul-06 3:24
charlieg7-Jul-06 3:24 
AnswerRe: What is wrong with this class - C2248 error Pin
Taka Muraoka7-Jul-06 3:29
Taka Muraoka7-Jul-06 3:29 
GeneralRe: What is wrong with this class - C2248 error Pin
charlieg7-Jul-06 3:39
charlieg7-Jul-06 3:39 
AnswerRe: What is wrong with this class - C2248 error Pin
Chris Losinger7-Jul-06 3:32
professionalChris Losinger7-Jul-06 3:32 
Questionusing C in VC express Pin
giddy_guitarist7-Jul-06 3:23
giddy_guitarist7-Jul-06 3:23 
AnswerRe: using C in VC express Pin
Chris Losinger7-Jul-06 3:27
professionalChris Losinger7-Jul-06 3:27 
AnswerRe: using C in VC express Pin
Zac Howland7-Jul-06 3:52
Zac Howland7-Jul-06 3:52 
GeneralRe: using C in VC express Pin
giddy_guitarist31-Mar-07 5:23
giddy_guitarist31-Mar-07 5:23 
QuestionStatic method, non-static variable Pin
Daniel Kanev7-Jul-06 2:45
Daniel Kanev7-Jul-06 2:45 
AnswerRe: Static method, non-static variable Pin
RChin7-Jul-06 3:11
RChin7-Jul-06 3:11 
AnswerRe: Static method, non-static variable Pin
Zac Howland7-Jul-06 4:01
Zac Howland7-Jul-06 4:01 
Questionoutlook Pin
pathakr7-Jul-06 2:44
pathakr7-Jul-06 2:44 
AnswerRe: outlook Pin
David Crow7-Jul-06 2:46
David Crow7-Jul-06 2:46 
Questionall urls Pin
yang__lee7-Jul-06 2:22
yang__lee7-Jul-06 2:22 
AnswerRe: all urls Pin
David Crow7-Jul-06 2:43
David Crow7-Jul-06 2:43 
AnswerRe: all urls Pin
Hamid_RT7-Jul-06 2:55
Hamid_RT7-Jul-06 2:55 
Questionto make a phone Pin
yogendra kaushik7-Jul-06 2:19
yogendra kaushik7-Jul-06 2:19 
AnswerRe: to make a phone Pin
Amit Agarrwal7-Jul-06 2:29
Amit Agarrwal7-Jul-06 2:29 
GeneralRe: to make a phone Pin
yogendra kaushik7-Jul-06 2:43
yogendra kaushik7-Jul-06 2:43 
AnswerRe: to make a phone Pin
David Crow7-Jul-06 2:44
David Crow7-Jul-06 2:44 
AnswerRe: to make a phone [modified] Pin
_AnsHUMAN_ 7-Jul-06 3:26
_AnsHUMAN_ 7-Jul-06 3:26 
AnswerRe: to make a phone Pin
ThatsAlok9-Jul-06 20:42
ThatsAlok9-Jul-06 20:42 
QuestionSetTimer call in CWinThread Pin
kumar_subrahmanya7-Jul-06 1:48
kumar_subrahmanya7-Jul-06 1:48 
Hi All,

I am using SetTimer API to create timers in a UI Thread (CWinThread
derived class)


The code looks as follows ->


m_timerId=::SetTimer(NULL,0,1000,NULL);

where m_timerId is a member data variable.


My Message map & onTimer looks as follows.


BEGIN_MESSAGE_MAP(CMyThread, CWinThread) <br />
ON_THREAD_MESSAGE(WM_TIMER, OnTimer) <br />
END_MESSAGE_MAP() <br />
<br />
<br />
void CMyThread::OnTimer(WPARAM wParam, LPARAM /*lParam*/) <br />
{ <br />
if(wParam==m_timerId) <br />
{ <br />
//timer processing code here <br />
<br />
<br />
<br />
} <br />
} 


This code works!!!!!!!!!!!!!!!!
But SetTimer API documentation does not talk about the above usage.
(where in both hWnd and callback functions are NULL)

Has any one tried this kind of usage of SetTimer with CWinThread
object?
If yes, do let me know if you have encountered any problems.


Regards


PS : Most of the documentations talk only about SetTimer working with
either window object or a call back but never with CWinThread!!!. I
have also seen complicated work arounds to make SetTimer work with
CWinThread. So I am little concerned to use this approach.
AnswerRe: SetTimer call in CWinThread Pin
David Crow7-Jul-06 2:55
David Crow7-Jul-06 2:55 
GeneralRe: SetTimer call in CWinThread Pin
kumar_subrahmanya9-Jul-06 20:19
kumar_subrahmanya9-Jul-06 20:19 

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.