- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm making my first attempt at using pointers and it's not going well. I'm trying to get a text string from a list view using the following:
type (T_LVITEM)item
-
-
-
case(WM_NOTIFY)
-
-
-
iret = SendMessage(hWndList,LVM_GETITEM,1,loc(item))
So far so good, item%psztext contains a value which I understand is:
- pszText
- Address of a null-terminated string containing the item text ....
But what do I do with it from here? I've been trying to equate psztext to a pointer associated with a text string, but if I declare the pointer thus:
character*80tstring
pointer(pstring,tstring)
I get an access violation, and if I do the following:
character*80, pointer:: pstring
whatever I do subsequently I get compiler errors. I realise I am doing something stupid here and I'd love to know what it is. Please can someone enlighten me. (Apologies if this message appears twice - I sent a very similar one 10 minutes ago and it seems to have vanished.)
Many thanks in advance,
Mike
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you want to create a character variable, (for example szText), then use the following to retrieve the text from the LV item or subitem:
! this assigns the address to where the LV item or subitem text is stored
item%pszText = loc(szText)
iret = SendMessage(hWndList, LVM_GETITEM, 0, loc(item))
After the Sendmessage() function is executed,the character variable szText will contain the character string for the LV item or subitem referenced.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page