From: SteveS on
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
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
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
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
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
>


 |  Next  |  Last
Pages: 1 2
Prev: How to convert 2 WCHAR to 1 WCHAR
Next: FreeImage