By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Bug in OnTimer?

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
>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
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.