|
-
Aug 11th, 2008, 12:04 AM
#1
Thread Starter
Frenzied Member
Pointer to a structure?
I'm doing this:
SendMessage(hWnd, LVM_GETITEM, Nothing, @), which @ should be a pointer to a structure called LVITEM, which I've made, but how do I make a pointer to a structure in Visual Basic .NET 2008??
IE:
Code:
Dim liItem As New LVITEM()
SendMessage(hWnd, LVM_GETITEM, Nothing, Pointer(liItem))
How do I do this?
Cheers
Icyculyr
-
Aug 11th, 2008, 08:14 AM
#2
Re: Pointer to a structure?
I'm sure there's a method in the InteropServices namespace that is called something like PtrToStructure that will do what you want. I used it the other day, I'll find out its exact name/location later if you havent already got it
EDIT: actually having read your question again, I think your going about this the wrong way. You dont want to be going from a pointer to a structure, you want to be going from a structure to a pointer. I'll see if there's a method for that, I think there is..
-
Aug 11th, 2008, 08:20 AM
#3
Re: Pointer to a structure?
Yeah, here it is:
vb Code:
System.Runtime.InteropServices.Marshal.StructureToPtr(STRUCTURE_HERE, POINTER_HERE, True)
-
Aug 12th, 2008, 02:54 AM
#4
Thread Starter
Frenzied Member
Re: Pointer to a structure?
Thanks, does anyone know what the value for LVM_GETITEM and LVM_DELETEITEM??
Cheers
Icyculyr
-
Aug 12th, 2008, 03:09 AM
#5
Re: Pointer to a structure?
-
Aug 12th, 2008, 03:33 AM
#6
Thread Starter
Frenzied Member
Re: Pointer to a structure?
Thanks, 2 things, How would I write out the LVITEM structure it's very complex (to me) to convert to VB.NET 08, I have tried, and I really doubt it would work... can anyone help with that?
LVITEM (Mine)
Code:
#Region " [LVITEM] "
Public Structure LVITEM
Dim mask As UInteger
Dim iItem As Integer
Dim iSubItem As Integer
Dim state As UInteger
Dim stateMask As UInteger
Dim pszText As String
Dim cchTextMax As Integer
Dim iImage As Integer
Dim lParam As IntPtr
Dim iIndent As Integer
Dim iGroupId As Integer
Dim cColumns As UInteger
Dim puColumns As IntPtr
End Structure
#End Region
Also, I did not see the value for LVM_GETITEM, I know how to use it, but when using the SendMessage API, what value would LVM_GETITEM have, would it be 1300? or 5610, I did not see any value on the MSDN page you gave me.
Cheers
Icyculyr
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|