Loading a combobox win32

Discussion in 'Win32' started by adii28, Jun 26, 2007.

  1. adii28

    adii28 New Member

    Jun 26, 2007
    Likes Received:
    Trophy Points:

    I am trying to create a combo box on a dialog using win32 api in vc++ 6.0. I added the combo box control using the dialog resource editor with type as Dropdown and owner draw set to 'No'. Then I add data to it programatically. I have the following classes

    class CmbBox: public SimpleControl {
    	CmbBox (HWND hwndParent, int id, BOOL initialState=TRUE)
    		 : SimpleControl (hwndParent, id, initialState)
       void AddItem (char* buf) {
                SendMessage(_hWnd, CB_ADDSTRING, (WPARAM)0, (LPARAM)buf);
       void SetString (char buf[20])
           SendMessage (_hWnd, WM_SETTEXT, 0, (LPARAM) buf);
    Then i create the object for CmbBox in another class Controller

    CmbBox _cmbSetting;

    and the constructor initializes it

    Controller::Controller (HWND hwnd)
    : _cmbSetting (hwnd, IDC_CMBSETTING)

    Then i call


    But when i execute the application there is no data in the combobox. I am able to create all other controls like list box and buttons, but combo box comes up without any data.

    Any pointers??

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice