I have a list view and I'm trying to get all of the text out of it. This is my code so far:

for(i= 0; i < NumOfItems; i++)
            char *text = new char[256];
              char *text2 = new char[256];
                                     // mask
              ListView_GetItemText(hWndListView, 0, 0, text, 256);
              ListView_GetItemText(hWndListView, 0, 1, text2, 256);
              MessageBox(hWnd, text, "", MB_OK | MB_ICONINFORMATION);

            delete [] text;
            delete [] text2;

But I don't know how to move to the next item, so I keeps doing the first item over and over again. Could someone please help me I've been trying for a while.

9 Years
Discussion Span
Last Post by curt22

First, don't allocate the buffers like that. Its just toooo much! If you want to use dynamic allocation then allocate them before the loop and delete them after the loop terminates.

>>But I don't know how to move to the next item
Increment the second parameter ??

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.