Thread: obtaining listview data efficiently...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211

    obtaining listview data efficiently...

    hey all,
    I am currently writing a function to obtain all of a listview control's data and store it into a multidimensional array of pointers. the reason for this is simply because it makes it easier for me to access each string of listview data.

    I have a listview (LVS_REPORT) with 4 columns. here is how I am declaring my multidimensional array of pointers:

    Code:
    char *szListData[50][4];
    where 50 is the max number of rows, and 4 is the number of columns. now here is how I am attempting to obtain the data:

    Code:
    for(i = 0; i < nListNum; i++)
         for(j = 0; j < 4; j++)
    	 ListView_GetItemText(hwndList, i, j, szListData[i][j], _MAX_FNAME);
    what am I doing wrong here? nListNum is the number of items listed in the listview, which is a number less than or equal to 50.

    whenever I attempt to print anything from szListData (just to see if it worked), Windows throws up an error message saying that the application needs to be closed.

    could anyone please tell me what I am doing wrong here?

    any help is greatly appreciated .
    Last edited by Bleech; 10-15-2006 at 10:32 PM.

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. binary tree of processes
    By gregulator in forum C Programming
    Replies: 1
    Last Post: 02-28-2005, 12:59 AM
  3. Dynamic data members?
    By confusalot in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2005, 11:15 AM
  4. Obtaining data through RS-232 port...
    By johny780 in forum C Programming
    Replies: 9
    Last Post: 10-08-2003, 10:38 AM
  5. All u wanted to know about data types&more
    By SAMSAM in forum Windows Programming
    Replies: 6
    Last Post: 03-11-2003, 03:22 PM