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

Stackoverflow....C#调用C++的DLL
C++接口定义
stcut TTable{};
DLL_API void Func(TTable& tTable)
{
    //对tTable进行操作
}

C#导出:
void DllFunc(out TTable tTable);

C#调用:

TTable tTable = new tTable();
DllFunc(out tTable);           //崩溃 “System.StackOverflowException”类型的未经处理的异常出现在 XX

两边结构体定义一样,sizeof也有一样,原因不明,求高手

------解决方案--------------------
你的代码不全,无法给你合适的答案。
建议你找本c++基础书,把关于拷贝构造函数,和operator=方面的知识补一补