FIX: ClassWizard Generates Bad Code for Tree View MessagesLast reviewed: September 18, 1997Article ID: Q137154 |
2.10
WINDOWS NT
kbtool kbbuglist kbfixlist
The information in this article applies to:
SYMPTOMSThe Class Wizard generates the following incorrect code for the TVN_BEGINLABELEDIT, TVN_ENDLABELEDIT, TVN_GETDISPINFO, TVN_SETDISPINFO, and TVN_KEYDOWN Tree View Control notification messages.
void CMyDialog::OnXXXXtreeview1(NMHDR* pNMHDR, LRESULT* pResult){ NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; // TODO: Add your control notification hander code here *pResult = 0;}
RESOLUTIONFor TVN_BEGINLABELEDIT, TVN_ENDLABELEDIT, TVN_GETDISPINFO, and TVN_SETDISPINFO, the pNMHDR parameter should be cast to a TV_DISPINFO*. For example:
void CMyDialog::OnXXXXtreeview1(NMHDR* pNMHDR, LRESULT* pResult){ TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; // TODO: Add your control notification hander code here *pResult = 0;} For TVN_KEYDOWN, the pNMHDR parameter should be cast to a TV_KEYDOWN*. For example:
void CMyDialog::OnXXXXtreeview1(NMHDR* pNMHDR, LRESULT* pResult){ TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*)pNMHDR; // TODO: Add your control notification hander code here *pResult = 0;}
STATUSMicrosoft 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++ version 4.0.
|
Additional reference words: 2.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |