Thread: GetDlgItemText with a listbox

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    26

    GetDlgItemText with a listbox

    Hi,

    I am trying to retrive the text that is located in a listbox. I am using:

    Code:
    GetDlgItemText(dlghwnd, LV_Course, EDC, 200);
    where LV_Course is my listbox and EDC is the string that is suppose to store the text. However when I run my program, EDC returns nothing.

    Any ideas?

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    You could check the return value to see if the function succeeded.
    Code:
    if (GetDlgItemText(dlghwnd, LV_Course, EDC, 200) == 0)
    {
       cout << "Unable to retrieve item." << endl;
    }
    If it failed, check to be sure EDC is a char buffer.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deal or No Deal listbox prob
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-30-2009, 06:53 PM
  2. ListBox Extra Data Storage
    By Welder in forum Windows Programming
    Replies: 1
    Last Post: 11-01-2007, 01:46 PM
  3. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 08:52 PM
  4. Listbox stealing focus
    By Calthun in forum Windows Programming
    Replies: 3
    Last Post: 09-12-2004, 04:36 PM
  5. Getting FULL filename from listbox
    By Garfield in forum Windows Programming
    Replies: 8
    Last Post: 01-27-2002, 08:28 AM