開發人員技術 | C#
物件導向且型別安全的程式設計語言,源自 C 語言系列,並包括支援元件導向程式設計的功能。
In C#, I imported the C DLL through LoadLibrary.
In .net3.5 I used Marshal.PtrToStructure to convert the pointer back to the structure
I successfully get int map_num equal to 1
But when I run .net4.8, I get 0x00007ffb. Why is this?
public struct _map_name_usr_param_t
{
public IntPtr ver_str;
public UInt32 ver;
}
[StructLayout(LayoutKind.Sequential, Pack = 2)]
public struct _map_list_usr_param_t
{
public int map_num;
[MarshalAs(UnmanagedType.ByValArray)]
public _map_name_usr_param_t[] maps;
}