Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Want to extract all the datas from a list box Pin
Albert Holguin16-Mar-11 13:40
professionalAlbert Holguin16-Mar-11 13:40 
GeneralRe: Want to extract all the datas from a list box Pin
Richard MacCutchan16-Mar-11 13:49
mveRichard MacCutchan16-Mar-11 13:49 
GeneralRe: Want to extract all the datas from a list box Pin
Albert Holguin16-Mar-11 14:33
professionalAlbert Holguin16-Mar-11 14:33 
GeneralRe: Want to extract all the datas from a list box Pin
leorex16-Mar-11 22:47
leorex16-Mar-11 22:47 
GeneralRe: Want to extract all the datas from a list box Pin
Richard MacCutchan16-Mar-11 22:58
mveRichard MacCutchan16-Mar-11 22:58 
GeneralRe: Want to extract all the datas from a list box Pin
leorex16-Mar-11 23:08
leorex16-Mar-11 23:08 
GeneralRe: Want to extract all the datas from a list box Pin
Richard MacCutchan17-Mar-11 1:25
mveRichard MacCutchan17-Mar-11 1:25 
GeneralRe: Want to extract all the datas from a list box Pin
leorex17-Mar-11 22:52
leorex17-Mar-11 22:52 
LOL still doesnt work. this problem is driving me insane... I need to link the filename with the item in the listbox >.<. why does it work on every single example i see on the web! Confused | :confused:

here is the full code. Please tell me if I made any mistake
case WM_COMMAND:
{
    switch(LOWORD(wParam))
    {
    case ID_CMP_LOADFILE:
    {
        OPENFILENAME ofn;
        TCHAR File_name[MAX_PATH];

            //the whole loadfile business here.
            int index = SendDlgItemMessage(hwnd, IDC_LIST_COMPARE, LB_ADDSTRING, 0, (LPARAM)str);
            sprintf(File_name, "1");//implanted this line just to make sure things goes in. I AM SURE ITS NT AN EMPTY STRING!


            SendDlgItemMessage(hwnd, IDC_LIST_COMPARE, LB_SETITEMDATA, (WPARAM)index, (LPARAM)File_name);

            HWND hList = GetDlgItem(hwnd, IDC_LIST_COMPARE);

            int data = SendMessage(hList, LB_GETITEMDATA, (WPARAM)index, 0);

            MessageBox (hwnd, (char *)data, "The stored data for the newly selected item is...", MB_OK);//works perfectly here.....

            fclose(file_opened);
        }
        break;
    }
    case ID_CMP_COMPARE:
    {
        int count;
        int i;
        HWND handle_list = GetDlgItem(hwnd, IDC_LIST_COMPARE);
        count = SendMessage(handle_list, LB_GETCOUNT, 0, 0);
        for (i =0; i<count; i++)
        {
            TCHAR* data = SendMessage(handle_list, LB_GETITEMDATA, (WPARAM)i, 0);
            MessageBox (hwnd, data, "The stored data for the newly selected item is...", MB_OK);//still nothing  :((
        }
        break;
    }


thank you all soo much.. i really need to crack this..
GeneralRe: Want to extract all the datas from a list box Pin
Richard MacCutchan18-Mar-11 0:41
mveRichard MacCutchan18-Mar-11 0:41 
GeneralRe: Want to extract all the datas from a list box Pin
leorex18-Mar-11 15:50
leorex18-Mar-11 15:50 
GeneralRe: Want to extract all the datas from a list box Pin
leorex16-Mar-11 23:01
leorex16-Mar-11 23:01 
QuestionError "member function already defined or declared" Pin
Miwin Solutions16-Mar-11 0:44
Miwin Solutions16-Mar-11 0:44 
QuestionRe: Error "member function already defined or declared" Pin
Niklas L16-Mar-11 1:58
Niklas L16-Mar-11 1:58 
AnswerRe: Error "member function already defined or declared" Pin
Miwin Solutions16-Mar-11 3:41
Miwin Solutions16-Mar-11 3:41 
GeneralRe: Error "member function already defined or declared" Pin
Niklas L16-Mar-11 3:59
Niklas L16-Mar-11 3:59 
GeneralRe: Error "member function already defined or declared" Pin
Miwin Solutions17-Mar-11 7:43
Miwin Solutions17-Mar-11 7:43 
Questionhow to get all handles of process Pin
so0_lanhlung216-Mar-11 0:09
so0_lanhlung216-Mar-11 0:09 
AnswerRe: how to get all handles of process Pin
Code-o-mat16-Mar-11 0:58
Code-o-mat16-Mar-11 0:58 
GeneralRe: how to get all handles of process Pin
so0_lanhlung216-Mar-11 5:10
so0_lanhlung216-Mar-11 5:10 
AnswerRe: how to get all handles of process Pin
Nuri Ismail16-Mar-11 1:04
Nuri Ismail16-Mar-11 1:04 
GeneralRe: how to get all handles of process Pin
so0_lanhlung216-Mar-11 5:09
so0_lanhlung216-Mar-11 5:09 
GeneralRe: how to get all handles of process Pin
Nuri Ismail16-Mar-11 7:00
Nuri Ismail16-Mar-11 7:00 
QuestionHow to write a safe RPC program? Pin
Finix15-Mar-11 23:22
Finix15-Mar-11 23:22 
QuestionCan we put dot [ . ] in the name of Win32 dll Pin
pandit8415-Mar-11 21:55
pandit8415-Mar-11 21:55 
AnswerRe: Can we put dot [ . ] in the name of Win32 dll Pin
_AnsHUMAN_ 15-Mar-11 23:06
_AnsHUMAN_ 15-Mar-11 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.