currently I have to develop a Wrappper-DLL in C# for a given dll.
I begin to figure out how it works. But now I've no clue how to continue.
I have a struct like this in the header file:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
publicstruct WV_BED_DESCRIPTION
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 26)]
public string PatientName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string PatientID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string BedLabel;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string CareUnit;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string FileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string IPAddress;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string MulticastIP;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string DeviceType;
public WV_OPERATING_MODE DeviceStatus;
publicint ConnectID;
}
My problem is: for ConnectID I get a memory address (pointer) instead of the value and I have no idea why.
As far as I understand this it should be an value shouldn't it?