P/Invoke Exceptions
-
Hello, If I call a (pure) C++ function from C# (using P/Invoke), and that function throws an exception, how will it be received in C#? Would it be wrapped into an object of
Exception
or one of its descendants? Thank you. -
Hello, If I call a (pure) C++ function from C# (using P/Invoke), and that function throws an exception, how will it be received in C#? Would it be wrapped into an object of
Exception
or one of its descendants? Thank you.I doubt it would be in a form that you'd hope, unless it's a COM exception. But yes, I imagine you'd get an exception that includes any message
Christian Graus Driven to the arms of OSX by Vista.
-
Hello, If I call a (pure) C++ function from C# (using P/Invoke), and that function throws an exception, how will it be received in C#? Would it be wrapped into an object of
Exception
or one of its descendants? Thank you.I tried it real quick. On the C# side I get a System.Runtime.InteropServices.SEHException Message == "External component has thrown an exception."
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I tried it real quick. On the C# side I get a System.Runtime.InteropServices.SEHException Message == "External component has thrown an exception."
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks a lot!