111,126
社区成员
发帖
与我相关
我的任务
分享
static void Main()
{
IntPtr pointer;
int i = ABC(..., out pointer, ...);
string header = Marshal.PtrToStringAnsi(pointer);
Marshal.FreeHGlobal(pointer); // free memory allocated by LocalAlloc()
Console.WriteLine(header);
Console.ReadLine();
}
[DllImport("my.dll")]
extern static int ABC(..., out IntPtr pointer, ...);