![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I need to be able to catch clr exceptions in unmanaged code. Anyone know how to do that? I'm able to catch native types, so there is obviously some marshalling going on, but I don't know what type the Exception^ is cast to. Any help will be greatly appreciated! |
#4
| |||
| |||
|
|
Hello, Erlend! Is it important for you to compile void Interop::Unmanaged() as unmanaged? If not you can remove #pragma unmanaged directive and add another catch. ... try { Managed_clre(); } catch(Exception ^ex) // Can only catch all to trap the clr exception! { Console::WriteLine(ex->Message); } ... -- Regards, Vadym Stetsyak www: http://vadmyst.blogspot.com |
#5
| |||
| |||
|
|
"Erlend" <erotvik (AT) broadpark (DOT) no> wrote: I need to be able to catch clr exceptions in unmanaged code. Anyone know how to do that? I'm able to catch native types, so there is obviously some marshalling going on, but I don't know what type the Exception^ is cast to. Any help will be greatly appreciated! I think it would probably be easiest to write a wrapper managed function that does the catch, and marshal the managed exception manually to your unmanaged code. -- Barry -- http://barrkel.blogspot.com/ |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |