日期:2014-05-17  浏览次数:20786 次

关于调用C++ DLL
我用C#调用了C++编写的DLL(A),而在A中又调用了一个DLL(B)中的函数,我发现这样去调会报错:Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
但是如果我直接用C# 调用DLL(B) 却能直接调用成功。是因为DLL(A)封装的不对吗?还是有其他原因?谢谢

------解决方案--------------------
你需要另外一个测试来证明问题到底是在C#调用A上还是A调用B上。否则都有可能。
------解决方案--------------------
你应该检查一下,参数类型,是不是没有传输正确。