473,498 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bug in OnTimer?

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
1 2972
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2215
by: Benny | last post by:
Hello Experts, Currently I am working on a windows application using VS.NET 2002 with C#. On one of my form, I have a refresh button which will dispose created controls and re-create them. I...
1
13367
by: Max Adams | last post by:
Using System.Timers.ElapsedEventHandler to specify a method and and ElapsedEventArgs object I've trawled the internet looking for some help on this topic. What I want to do is, every x seconds...
2
1500
by: Cem Louis | last post by:
Hi, I have the below code which runs after choosing an item from the listbox (choose the first one). Goes to the below item after 5 seconds and then goes to another after 5 sec again... So here...
2
2167
by: MLH | last post by:
I have a form (frmCron) whose code in the OnTimer event property is set by the TimerInterval property to run 86400000 milliseconds. I open this form in the AutoExec sequence when the mdb file...
2
4083
by: Henry Stockbridge | last post by:
Hi, I have a form that I need loaded and visible prior to another form being loaded (hidden.) I am opening the main form, then using the OnTimer event (with a timer interval of 2000) to open...
7
6250
by: Ron | last post by:
Hi All, Have just discovered this great tool to hide a form if it hasn't been used in awhile. However, I have a form that can call up another screen (modal) that can then call up another one...
2
1788
by: Jimmy | last post by:
Will setting the ontimer interval to a low number cause memory problems down the Line? I have a text box to display the time and set the forms ontimer interval to 1000ms (1 second) so the box...
8
2638
by: ontherun | last post by:
Hi All, I want to include some code for the OnTimer event in my Form "frmDueDateList" But when i open the form in the design view and checked the properties menu, i could not find the OnTimer...
4
2313
by: =?Utf-8?B?R29yZnk=?= | last post by:
Hey everyone. This is only my first week with C#, but I use actionscript a lot in Flash, so I have a very basic understanding of programming, but bear with me... I am trying to create a...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.