Prev: How to convert 2 WCHAR to 1 WCHAR
Next: FreeImage
From: SteveS on 9 Sep 2009 10:59 studio 2005 vc8 my code : ------------------------------------------- UINT nHandle = StartTimer(5000); UINT CMainFrame::StartTimer(int nInterval) { UINT nTimer = SetTimer(1, nInterval, NULL); return nTimer; } void CMainFrame::OnTimer(UINT_PTR nIDEvent) { DoStuff(); //default handling CFrameWnd::OnTimer(nIDEvent); } //------------------------------------------------ OnTimer in never called! Am i missing something? Thanks
From: Guido Franzke on 9 Sep 2009 11:34 Your code is ok. Do you have OnTimer in your message map? BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ON_WM_TIMER() .... HTH Guido "SteveS" <sserrell(a)wagstaff.com> schrieb im Newsbeitrag news:OAkeh4VMKHA.3704(a)TK2MSFTNGP06.phx.gbl... > studio 2005 vc8 > > my code : ------------------------------------------- > > > UINT nHandle = StartTimer(5000); > > UINT CMainFrame::StartTimer(int nInterval) > { > UINT nTimer = SetTimer(1, nInterval, NULL); > return nTimer; > } > > void CMainFrame::OnTimer(UINT_PTR nIDEvent) > { > DoStuff(); > > //default handling > CFrameWnd::OnTimer(nIDEvent); > } > > //------------------------------------------------ > > OnTimer in never called! > > Am i missing something? > > Thanks > >
From: Scott McPhillips [MVP] on 9 Sep 2009 12:13 You didn't make it clear where you are calling StartTimer. If you call it before the CMainFrame window has been created then it cannot work. Calling SetTimer from CMainFrame::OnCreate would work. "SteveS" <sserrell(a)wagstaff.com> wrote in message news:OAkeh4VMKHA.3704(a)TK2MSFTNGP06.phx.gbl... > studio 2005 vc8 > > my code : ------------------------------------------- > > > UINT nHandle = StartTimer(5000); > > UINT CMainFrame::StartTimer(int nInterval) > { > UINT nTimer = SetTimer(1, nInterval, NULL); > return nTimer; > } > > void CMainFrame::OnTimer(UINT_PTR nIDEvent) > { > DoStuff(); > > //default handling > CFrameWnd::OnTimer(nIDEvent); > } > > //------------------------------------------------ > > OnTimer in never called! > > Am i missing something? > > Thanks > -- Scott McPhillips [VC++ MVP]
From: SteveS on 9 Sep 2009 12:43 Yes, I have the ON_WM_TIMER() mapped and I'm calling it well after creation. I do have timers in other apps that work just fine, I can't seem to nail this one down. "SteveS" <sserrell(a)wagstaff.com> wrote in message news:OAkeh4VMKHA.3704(a)TK2MSFTNGP06.phx.gbl... > studio 2005 vc8 > > my code : ------------------------------------------- > > > UINT nHandle = StartTimer(5000); > > UINT CMainFrame::StartTimer(int nInterval) > { > UINT nTimer = SetTimer(1, nInterval, NULL); > return nTimer; > } > > void CMainFrame::OnTimer(UINT_PTR nIDEvent) > { > DoStuff(); > > //default handling > CFrameWnd::OnTimer(nIDEvent); > } > > //------------------------------------------------ > > OnTimer in never called! > > Am i missing something? > > Thanks >
From: SteveS on 9 Sep 2009 12:58
I got it, I got rid of a mapped call to a slider control. Somehow it was interfering with the works. Don't ask me why. Thanks for the help gang. Steve "SteveS" <sserrell(a)wagstaff.com> wrote in message news:OAkeh4VMKHA.3704(a)TK2MSFTNGP06.phx.gbl... > studio 2005 vc8 > > my code : ------------------------------------------- > > > UINT nHandle = StartTimer(5000); > > UINT CMainFrame::StartTimer(int nInterval) > { > UINT nTimer = SetTimer(1, nInterval, NULL); > return nTimer; > } > > void CMainFrame::OnTimer(UINT_PTR nIDEvent) > { > DoStuff(); > > //default handling > CFrameWnd::OnTimer(nIDEvent); > } > > //------------------------------------------------ > > OnTimer in never called! > > Am i missing something? > > Thanks > |