CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    181

    [RESOLVED] ComboBox contains only one string!

    Code:
    		case WM_SHOWWINDOW:
    		    {HWND cbox = GetDlgItem(hDlg, IDC_COMBO1);
    			 int cnt = GetPortsCount();
    			 for (int i= 0; i<cnt; i++)
    			 { 
                               SendMessage(cbox, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>((LPCTSTR) GetPort(i)));
    			 }
    			 break;}
    cnt = 3, but combobox contains only one string. How correctly make it? I also test "0" to "i" - the same effect. I viewed this in one example.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: ComboBox contains only one string!

    How did you detect that combobox contains only one string? Did you use CB_GETCOUNT message?
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2012
    Posts
    181

    Re: ComboBox contains only one string!

    VictorN, it was small sorry really now all work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured