Problem with CComboboxEx / InsertItem...
Hi group;-)
Ive a little problem with a CComboboxEx-derived class and to check it,
i created a little test-dlg. i found that i have the same problem
without derivation and so ... here it is.
i have a dialog with a single CComboboxEx without imagelist (the
reference stated that i can can do this) and my system is VC6.
______________________________________
class CTestDlg : public CDialog{
public:
CTestDlg(CWnd* pParent = NULL); // standard constructor
//{{AFX_DATA(CTestDlg)
enum { IDD = IDD_TEST_DIALOG };
CComboBoxEx m_Testcombo;
//}}AFX_DATA
//{{AFX_VIRTUAL(CTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CTestDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
______________________________________
I do the following:
______________________________________
BOOL CTestDlg::OnInitDialog(){
CDialog::OnInitDialog();
COMBOBOXEXITEM item;
ZeroMemory(&item, sizeof(item));
item.iItem = -1;
item.pszText = _T("TEST");
int iReturn = m_Testcombo.InsertItem(&item);
return TRUE;
}
______________________________________
i expected to have "TEST" in my Combo, but it stays emty.
iReturn is 0...?
Has anyone some enlightenment for me, please?