他的回复:
我定义的结构体: public struct ADDRESSID{ public int usType; public string pcAddress;}具体调用:public void HoldParticipantAgentConf(string strPhoneNum){ ADDRESSID pAddressIdInfo = new ADDRESSID(); pAddressIdInfo.pcAddress = strPhoneNum; if (Regex.IsMatch(strPhoneNum, @"^1\d{3}$")) { pAddressIdInfo.usType = 9; } else { pAddressIdInfo.usType = 6; } IntPtr intptr = Marshal.AllocHGlobal(Marshal.SizeOf(pAddressIdInfo)); Marshal.StructureToPtr(pAddressIdInfo, intptr,true); FLog.WriteLine(string.Format("_ccx.HoldParticipantAgentConf() pAddressId:{0}", (int)intptr)); int nRet = _ccx.HoldParticipantAgentConf(_confInfo.ConfID, (int)intptr, 1, ""); Marshal.FreeHGlobal(intptr); FLog.WriteLine(string.Format("_ccx.HoldParticipantAgentConf() return value:{0},error:{1}", nRet, _ccx.GetPromptByErrorCode(nRet)));}其中:FLog是日志输出。(int)intptr)=294742808,nRet=21237日志见下图: