Combobox-problem

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Hello,

I've been trying all day to add some Strings to a combobox. But it
doesn't seem to work. So I beg you for some help!

This is what I did:

void CBPLCgeneratorDlg::OnCbnSelchangeCmdname()
{
extern Ccombo* cmdname;
cmdname.AddString("Test");
}

cmdname is the variable of my combobox
Ccombo is the class I made.

But I still get this error:

error C2228: left of '.AddString' must have class/struct/union type

Please help me!

Thx Randy
 
Randy said:
Hello,

I've been trying all day to add some Strings to a combobox. But it
doesn't seem to work. So I beg you for some help!

This is what I did:

void CBPLCgeneratorDlg::OnCbnSelchangeCmdname()
{
extern Ccombo* cmdname;
cmdname.AddString("Test");
}

cmdname is the variable of my combobox
Ccombo is the class I made.

But I still get this error:

error C2228: left of '.AddString' must have class/struct/union type

You're calling through a pointer so you'd want to use '->' instead of '.' I
reckon. I'm not sure how or where your pointer to Ccombo is initialized, but
the syntax you show looks rather suspect to me.
 
Back
Top