CB_GETCURSEL problem

This is a discussion on CB_GETCURSEL problem within the Windows Programming forums, part of the Platform Specific Boards category; hi, CB_GETCURSEL is alway returning zero although i have selected some nozero index... Why? Code: sel=SendMessage(dlg->hHost,CB_GETCURSEL,0,0); When i open it ...

  1. #1
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119

    CB_GETCURSEL problem

    hi,
    CB_GETCURSEL is alway returning zero although i have selected some nozero index... Why?

    Code:
    sel=SendMessage(dlg->hHost,CB_GETCURSEL,0,0);
    When i open it in debug mode and see value of 'sel' after this statement it is always zero ... why??? what could be wrong...

    dlg->hHost is HWND to combo box.
    Software is like sex it is good when it is free

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Looks fine, are you sure that the HWND you pass is a valid value ?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    or try

    iIndex = SendDlgItemMessage(hDialog , IDC_COMBO, CB_GETCURSEL, (WPARAM)0, (LPARAM) 0); //use the ID# and the parents HWND
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21