Re: Problem with CComboboxEx / InsertItem...
On 6 Aug., 20:49, "David Ching" <d...@remove-this.dcsoft.com> wrote:
".rhavin grobert" <cl...@yahoo.de> wrote in message
news:1186426032.955227.152230@g4g2000hsf.googlegroups.com...
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?
I think you need to specify CBEIF_TEXT in the .mask field.
-- David- Zitierten Text ausblenden -
- Zitierten Text anzeigen -
em. sorry, by pasting it into the post, i removed a line to much;-)
the correct code is
______________________________________
BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
COMBOBOXEXITEM item;
ZeroMemory(&item, sizeof(item));
item.mask = CBEIF_TEXT;
item.iItem = -1;
item.pszText = _T("TEST");
int iReturn = m_Testcombo.InsertItem(&item);
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
return TRUE; // return TRUE unless you set the focus to a control
}
______________________________________
and i have an emty box after that.