Hi renpeng0401,
感谢你在MSDN论坛发帖。
因为C++是非托管代码,是需要自己手动释放内存,C#是托管代码,内存是有CLR帮我们管理。两者在互调的时候,就涉及到内存管理的问题。
我觉得问题应该是这个地方出现问题,导致stack over flow 。
关于Interoperability问题,你可以看下面微软的链接。
Calling Native Functions from Managed Code
Call Native DLLs from Managed Code Using PInvoke。
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints
to MSDN Support, feel free to contact MSDNFSF@microsoft.com.