Microsoft KB Archive/133276

= FIX: ClassWizard Generates Incorrect UDN_DELTAPOS Handler =

Article ID: 133276

Article Last Modified on 10/17/2003

-

APPLIES TO

 The ClassWizard, when used with:  Microsoft Visual C++ 2.1

 Microsoft Visual C++ 6.01 Professional Edition 

-



This article was previously published under Q133276



SYMPTOMS
ClassWizard creates incorrect code for a handler for the UDN_DELTAPOS notification message of the CSpinButtonCtrl common control.



RESOLUTION
The generated handler function will look like this (assuming that the CSpinButtonCtrl is in a dialog): void CAboutDlg::OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult) {     NM_UPDOWN; // TODO: Add your control notification handler code here

*pResult = 0; } Modify the code to look like this: void CAboutDlg::OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult) {     NM_UPDOWN* pUpDown = (NM_UPDOWN*)pNMHDR;

// TODO: Add your control notification handler code here

*pResult = 0; } By typecasting the pointer to the NMHDR structure, you can access additional data that is passed after the NMHDR.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++, 32-bit Edition, version 4.0.

<div class="references_section">