A common error occurring when compiling a 64-bit application: error C2440, OnTimer

One of the most common errors a programmer encounters when porting applications from a Win32 system to a Win64 one is the error related to the function OnTimer. The function OnTimer is used nearly in every application and you are likely to get some compilation errors. Earlier this function had the prototype “OnTimer(UINT nIDEvent)” and is most likely to be present in user classes in the same form. Now this function has the prototype “OnTimer(UINT_PTR nIDEvent)” and it causes a compilation error for the 64-bit system.

Continue reading