darkriser
asked on
HowTo throw custom C++ Exception and catch it in C# ?
I need to throw a custom exception in C++ DLL and catch it for further processing in C# code using this DLL. I need to pass a simple STRUCT having few unsigned int member variables. How to manage that?
Of course, I have access to both source codes, C++ and C#, as well...
Of course, I have access to both source codes, C++ and C#, as well...
ASKER
thanks...
but this hint requires compilation using /clr option.
this is something I need to avoid.
unfortunately...
but this hint requires compilation using /clr option.
this is something I need to avoid.
unfortunately...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is not the answer for my question but this is exactly how to solve my problem:-)
Thanks for those ideas...
Thanks for those ideas...
Here
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/0624f3b3-5244-4cb8-be9c-29d464975d20/
they show (at the bottom) how to generate a wrapper that translates an exception (in their case, a string exception, but the unsigned would be similar).