I'm having a hard time figuring out how to get the first element of an array converted into a pointer for an argument in a function. Here's the function's arguments I'm working with:
VB Code:
<System.Runtime.InteropServices.DllImport("DX8VB.DLL", _ EntryPoint:="D3DVertexBuffer8SetData", _ SetLastError:=True, _ CharSet:=System.Runtime.InteropServices.CharSet.Unicode, _ ExactSpelling:=True, _ CallingConvention:=System.Runtime.InteropServices.CallingConvention.StdCall)> _ Public Shared Function D3DVertexBuffer8SetData(ByRef VBuffer As DxVBLibA.Direct3DVertexBuffer8, ByRef Offset As Long, ByRef Size As Long, ByRef Flags As Long, ByRef Data As System.IntPtr) As Long End Function
Where I'm receiving an error at is in the ByRef Data As System.IntPtr argument.
Here are the values I put in
VB Code:
D3DAUX.D3DVertexBuffer8SetData(VBuffer, 0, Len(Cube2(0)) * 36, 0, System.IntPtr(Cube2(0)))
System.IntPtr(Cube2(0)) is where I get the error. It says IntPtr is a type in 'System' and cannot be used as an expression. Any ideas of how I can solve this?!!


Reply With Quote