C# 调用带 out 参数 读取返回值问题

2025-05-17 11:06:34
推荐回答(1个)
回答(1):

// Try:
[DllImport("XNHInterface.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
static extern int getPersonInfo(string personNo, string flag, string name, string sex, string birthday, string idCard, string hMaster, string errorMsg);

// call:
int i = getPersonInfo(out personNo,out flag,out name,out sex,out birthday,out idCard,out hMaster,out errorMsg);