日期:2014-05-18  浏览次数:20938 次

c# 调用c++ dll,参数里面传递嵌套的数组
函数: void SipRegister(UserConfig* conf,void (CALLBACK* SipEvent)(int iLineNumber, int iEventType, WPARAM Param, LPARAM lParam, void* pInstance), void* pAppInstance);

typedef struct _user_configure
{
SipSupportCodec SupportCodec;
SipUserConfig SipConfig;
}UserConfig;

typedef struct _support_codec
{
int iSupportCodecNumbers;
CodecInfo CodecInfos[16];//
}SipSupportCodec;

typedef struct _codec_info
{
int iPayLoadType; // 编码的PayLoadType
int iSampleRate; //采样率
char szName[32];// 名字,也就是MIME
}CodecInfo;

typedef struct _user_sip_configure
{
char szPhoneNumber[CONF_ITEM_LEN]; // 号码
char szUserName[CONF_ITEM_LEN]; //用户名,可以和号码相同
char szPassword[CONF_ITEM_LEN];//密码
char szDomain[CONF_ITEM_LEN];//Domain,可以和Proxy相同
char szProxy[CONF_ITEM_LEN];//注册的服务器地址
char szStun[CONF_ITEM_LEN];// stun服务器地址
int iSipPort; //本地的 Sip使用的端口
int iRTPProt;//本地的 RTP 使用的端口
bool bUseStun; //是否使用stun
bool bAutoRegister;// 是否自动注册,建议值设为1
}SipUserConfig;

我自己写的老是提示参数错误 ,我就不贴了,请各位帮帮忙



------解决方案--------------------
做个实体类对应传进去就可以了吧