调用一个自己写的c++的 dll,结果出现问题提示如下:“System.AccessViolationException”类型的未经处理的异常出现在 BidingSystem_Client.exe 中。其他信息: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。--------------------------------------------
c#
[DllImport("PEKS.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        //对明文进行加密
        static extern void Enc(string plain);----------------------------------------------
c++
void Enc(string plain)
{
//模拟上传文件加密
//加密文件
char aes_key[33];
Miracl precision(16,0);  ECn point_key;
miracl *mip=&precision; point_key.iszero();
aes_set(point_key, aes_key);//准备好aes的密钥,点密钥为point_key, 字符串密钥为aes_key
int len = plain.length();           
string name = plain.substr(0, len - 4);           //获得去掉后缀的文件名
string cipher ="ciphertext\\" + name + ".aes";           //获得密文文件存储路径
plain = "plaintext\\" + plain;
    aes_enc(plain, cipher, aes_key);                 //用aes加密
ifstream file("plaintext\\" + name + ".key");
string keyword;
while(getline(file,keyword, ' '))
{
char word[80];                                       //将string型的keyword转化为char*型的word
strcpy(word, keyword.c_str());
peks_enc(word, "ciphertext\\" + name +".kw");       //用PEKS加密关键词放在文件夹ciphertext中的.kw文件中
}
fIBE_enc(point_key, "ciphertext\\" + name + ".ak");          //加密对称密钥aes_key
file.close();
}求各位大神的解答