c#调用c++ 尝试读取或写入受保护的内存
c#调用c++ 尝试读取或写入受保护的内存,怎么解决
c++ API:
void MD_InitMessageInfo(
MD_MessageInfo* MessageInfo // pointer to MD_MessageInfo struct
)
The MD_InitMessageInfo structure initializes an MD_MessageInfo structure in
preparation for sending an email message using MD_SpoolMessage.
Parameters
MessageInfo - pointer to an MD_MessageInfo structure. This members of this
structure are cleared and the priority member is set to
MD_PRECEDENCE_NORMAL.
Remarks
You should call this function immediately after declaring an MD_MessageInfo
structure.
Example
MD_MessageInfo MessageInfo;
MD_InitMessageInfo(&MessageInfo);
MDUser.InitMessageInfo MessageInfo
This method initializes the MessageInfo object in preparation for sending an email message
using MDUser.SpoolMessage.
Parameters
MessageInfo - MDMessageInfo ojbect. The priority attribute is set to
MD_PRECEDENCE_NORMAL.
Remarks
You should call this method immediately after creating an instance of the MDMessageInfo object.
MDUser mdu = new MDUser();
MDMessageInfo MessageInfo = new MDMessageInfo();
MessageInfo.To = "test1@ceshi.com";
MessageInfo.From = "test2@ceshi.com";
MessageInfo.Subject = "邮件主题";
MessageInfo.MessageBody = "邮件正文内容";
mdu.InitMessageInfo(MessageInfo);
MDUser mdu = new MDUser();
MDMessageInfo MessageInfo = new MDMessageInfo();
MessageInfo.To = "test1@ceshi.com";
MessageInfo.From = "test2@ceshi.com";
MessageInfo.Subject = "邮件主题";
MessageInfo.MessageBody = "邮件正文内容";
// The priority attribute is set to MD_PRECEDENCE_NORMAL.
MessageInfo.Priority = MD_PRECEDENCE_NORMAL; // 自己在接口文档中找这个常量的定义
mdu.InitMessageInfo(ref MessageInfo); // 标记 ref