C# 调用C++ DLL 尝试读取或写入受保护的内存

检查C++导出DLL的函数中是否有那个地方未使用指针

例如:

InvFileIndex index;

CosInvFileMatching* retrieval = new CosInvFileMatching(index);

是不对的。

必须是

InvFileIndex* index = new InvFileIndex;

CosInvFileMatching* retrieval = new CosInvFileMatching(*index);

 

 

你可能感兴趣的:(C# 调用C++ DLL 尝试读取或写入受保护的内存)