BUG: DDX_ and DDP_ Functions Don't Work for ComboBoxEx in COlePropertyPage (246687)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q246687 SYMPTOMS
If the user has an extended combo box in a COlePropertyPage class, and uses the DDX_ functions and the DDP_ functions to set a control property with the extended combo box control, the property is not persisted when the selection is changed in the extended combo box.
CAUSE
The problem is in the COlePropertyPage::OnCommand function in the Ctlppg.cpp file. This function calls the SetControlStatus and SetModifiedFlag functions in response to a CBN_EDITCHANGE notification message, but only if the class name of the window is "COMBOBOX".
The COlePropertyPage::OnCommand function also needs to call the SetControlStatus and SetModifiedFlag functions in response to a CBN_EDITCHANGE notification message for the class name "COMBOBOXEX32".
RESOLUTION
To work around this problem, you can handle the CBN_EDITCHANGE notification and call SetControlStatus and SetModifiedFlag.
The code for the message map and the handler function should resemble the following:
BEGIN_MESSAGE_MAP(CTestPropPage, COlePropertyPage)
//{{AFX_MSG_MAP(CTestPropPage)
ON_CBN_EDITCHANGE(IDC_COMBOBOXEX1, OnEditchangeComboboxex1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CTestPropPage::OnEditchangeComboboxex1()
{
SetControlStatus(IDC_COMBOBOXEX1, TRUE);
SetModifiedFlag ();
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 12/11/2003 |
---|
Keywords: | kbBug kbComboBox kbDlg kbPersistSt kbPropSheet KB246687 |
---|
|