Hi,
I have some VB6 code that calls unmanaged DLLs, and I am converting it to
C#. There's a couple of structs I need to define. I've had no problems with
this one:
Public Type A
sz(128) As Byte
End Type
The above VB6 translates happily into C# as the following:
public struct A {
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=128)]
public string sz;
}
However, I'm not sure what to do with this one:
Public Type B
dwData(34) As Long
End Type
I'm sure dwData(34) is a DWORD array of lengh 34, and a DWORD is a 32-bit
unsigned integer, so I tried this:
public struct B {
[MarshalAs(UnmanagedType.U4,SizeConst=34)]
public uint dwData;
}
Unfortunately, it isn't working. How should I define a DWORD array in C#?
Any help would be appreciated!
Paul