Can anyone show me what VB .NET language is required to send a structure with an array to a unmanaged code function that needs the structure elements in contiguous memory locations? I've tried some recommendations but those have failed. I'd really like to SEE an example that actually works.
Here are code extractions - an example of what I'm attempting to do in VB .NET CODE
'structure - since this is managed the element addresses are dispersed in memory (12 bytes, 68 bytes apart, and others?
Public Structure pbu
Public t1 As Shor
Public t2 As Shor
Public c1(4) As byt
End Structur
'pinvoke declar
'structure ob
Public pbuffer As New pbuf(
Declare Function pfun Lib "xxxlib32.dll" (ByVal F1 as short, ByRef F2 As pbuf
'structure ob
Dim pbuffer As New pbuf(
'call functio
pfun(1, pbuffer) '<---- the function wants the pbuffer mapped sequentially and in one memory bloc
Can someone show me what is required syntactically with all of the marshalas, layoutkind, pack etc. statements
Thank
J