Simple Combobox problem

I am trying to add a combo box in a dialog box. I am able to create the combo box but when I try to add some items, it won't add them. Here's the sample code:

1
2
3
4
5
6
7
8
9
10
11
case WM_INITDIALOG:
   {
      HFONT compFont =(HFONT)GetStockObject(DEFAULT_GUI_FONT);
      char *myStr = "Hello";

      CreateWindowA("COMBOBOX", NULL, WS_CHILD | WS_VISIBLE | CBS_DROPDOWN, 
	50, 55, 50, 30, hwnd, (HMENU)IDC_TXT_SIZE, NULL, NULL);	
      SendDlgItemMessage(hwnd, IDC_TXT_SIZE, WM_SETFONT, (WPARAM)compFont, 0);

      SendDlgItemMessage(hwnd, IDC_TXT_SIZE, CB_ADDSTRING, 0, (LPARAM)myStr);
   }


Can you tell me what am I doing wrong here?
Ok, I found the problem. I increased the height from 30 to 100 and added WS_VSCHROLL and it worked.

But I want to know if I can add an integer to a Combo Box. eg : int myInt = 30 and then add myInt to Combo Box. Thanks!
Anyone?
Topic archived. No new replies allowed.