Im using ListView Report style and i wont to move items with subitem to another listView.

I tried with GETITEM but the problem is i dont now how to get text lenght. So maby someone know another method or how to obtain item TextLenght.
Posted on 2003-07-02 07:18:23 by AceEmbler
You have to call the ListView_GetItem with the TV_ITEM structure filled out with :

LVIF_TEXT in imask
an empty Buffer in pszText
and the Buffer size in ccTextMax

Once you get the Text in the Buffer all you do is a strlen :)

Posted on 2003-07-02 08:16:38 by JimmyClif
my buffer is growable heap so i dont know its max sieze. And i do not know the max lenght of item text either. DAMN it List view is such a lack.
Posted on 2003-07-02 09:45:46 by AceEmbler
Maybe you could try reading the items text with LVM_GETITEMTEXT to a buffer, say, 4k long, and check the return value, and if the buffer was completely filled increase it's size to another 4k and try again... you can keep increasing the buffer size until the whole string has been read. You can use 4k increases because it's the system granularity, so all memory blocks are a multiple of 4k (I think)...
Posted on 2003-07-02 10:35:59 by QvasiModo
thx ppl but i just mov ccTextMax,100 (i hope nobody have more than 100 bytes long telephon number ) :grin: btw i hope its not affecting my growable heap ???
I means that my heap will not be reised to 100 bytes ??
Posted on 2003-07-02 11:36:42 by AceEmbler
Nope, It will just fill the first 100 bytes of your buffer with the string (unless the string was shorter). I don't really know what happens if the string is longer, win32.hlp does not say. I think it's one of two choices:
1) it copies the first 100 bytes and returns 100 in eax
2) it does nothing and returns 0 (error)
I guess you'll have to try for yourself ;)
Posted on 2003-07-02 11:40:39 by QvasiModo