抛异常问题

来源:互联网 发布:项目管理软件.知乎 编辑:程序博客网 时间:2024/04/29 19:31

用C#编写dll ,VC2008调用该Dll。

C# 函数抛出异常:String ^ str = "My Exception";  throw new Exception( str );

testDll.exe   :  catch (char * e )

调试报错:   在 System.Runtime.InteropServices.SEHException 中第一次偶然出现的“testDll.exe”类型的异常


原因:捕获异常参数类型 与 抛异常的参数类型  不一致。

0 0