Thread: Man, I hate having to do this...

  1. #1
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256

    Man, I hate having to do this...

    Code:
    COMBOBOX IDC_BIH_BITCOUNT, 187, 70, 35, 12, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL
    Code:
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"1\0");
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"4\0");
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"8\0");
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"16\0");
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"24\0");
    SendDlgItemMessage(hwnd, IDC_BIH_BITCOUNT, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"32\0");
    I hate having to ask for help so much, but this one's got me stumped. I get nadda in the Combo Box's drop down list. I've looked through MSDN's stuff on Combo Boxes I don't know how many times. And don't say my problem is that hwnd isn't the Dialog or is NULL or something, cause I'm using the function on about twenty other Edit Controls and it works fine.
    Code:
    void function(void)
     {
      function();
     }

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    76
    It looks good, but you dont have to add \0 at the end of every string. If you use "sometext" the \0 is automaticaly added. I think you now have 2 "\0" at the end. But that shouldnt be the problem......
    I THINK (dont know for shure) your problem is the "COMBOBOX " which should be "CONTROL" .
    Anyway, here is some code that does work.

    Code:
    CONTROL "", IDCBITRATE, "ComboBox", WS_BORDER|CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP, 68, 44, 40, 40
    
    SendMessage(GetDlgItem(hwnd,IDCBITRATE), CB_ADDSTRING, 0, (LPARAM)"128");

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Assuming the return value from CB_ADDSTRING is as it should be then increase the height of the combobox; the height is the total of the drop down list and edit parts.

    >>this one's got me stumped<<

    The height issue with comboboxes catches many, if not most, out.

    >>I THINK (dont know for shure) your problem is the "COMBOBOX " which should be "CONTROL" .<<

    Both are acceptable: resource definition statements.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    76
    Quote Originally Posted by Ken Fitlike
    Assuming the return value from
    >>I THINK (dont know for shure) your problem is the "COMBOBOX " which should be "CONTROL" .<<

    Both are acceptable: resource definition statements.
    I always use a resource editor, so i dont know to much about resource files as you can see

  5. #5
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    I had a feeling I needed to do something like that. But, the way I understood it was that you only needed to do any of that work for owner-drawn combo boxes. What messages and such should I be looking into?

    Ahh, nevermind. Yay, now I can finally get some work done. Thanks a lot.
    Last edited by Jaken Veina; 07-05-2005 at 12:45 AM.
    Code:
    void function(void)
     {
      function();
     }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tabbed Windows with MDI?
    By willc0de4food in forum Windows Programming
    Replies: 25
    Last Post: 05-19-2005, 10:58 PM
  2. Pet Peeves
    By Srg Pepper in forum A Brief History of Cprogramming.com
    Replies: 29
    Last Post: 10-03-2002, 11:34 AM
  3. we of the cage
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 08-21-2002, 10:14 AM
  4. Gender Humour Thread
    By stevey in forum A Brief History of Cprogramming.com
    Replies: 39
    Last Post: 06-01-2002, 01:12 PM
  5. Man, I really hate Microsoft...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 09-12-2001, 08:50 AM