Bug in OnTimer?

  • Thread starter Thread starter Luke Duke
  • Start date Start date
L

Luke Duke

vc++ v7.1

Whenever I add an OnTimer message handler via the properties pane, I
get the following code added to my files:

afx_msg void OnTimer(UINT nIDEvent);

- and -

void CMyWnd::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call
default

CWnd::OnTimer(nIDEvent);
}

I'm actually doing a cast on the event ID to a HANDLE, and the
compiler complains of a 64 bit conversion problem.

Question:

After looking through the help files, shouldn't the OnTimer prototype
be declared using UINT_PTR, ala:

afx_msg void OnTimer(UINT_PTR nIDEvent);

Luke
 
I'm actually doing a cast on the event ID to a HANDLE

.... why are you doing that, it's only an integer value?
After looking through the help files, shouldn't the OnTimer prototype
be declared using UINT_PTR, ala:

afx_msg void OnTimer(UINT_PTR nIDEvent);

It's perhaps going to change in the future, though it's strange for
the docs to be more up-to-date than the code. It shouldn't have any
significance unless you're compiling for 64-bit, or have the 64-bit
warning setting enabled.

Dave
 
Back
Top