D
dragonslayer008
I read in a C++/CLI book that:
"In C++/CLI, exceptions are always thrown on the managed heap, never
the stack."
So I'm wondering if this will be a problem for me. Here is my
situation.
I am using C++/CLI mainly to wrap some unmanaged C++ code so the code
can be used from C# via a DLL. My unmanaged code can throw some
exceptions (unmanaged exception class).
My question is, can the methods of the managed class try and catch the
unmanaged exceptions? That is, could I write something like this in a
managed class method:
try
{
native->foo();
}
catch( NativeException e)
{
...
}
If not, I guess I need to move the native exception handling down into
the unmanaged classes?
"In C++/CLI, exceptions are always thrown on the managed heap, never
the stack."
So I'm wondering if this will be a problem for me. Here is my
situation.
I am using C++/CLI mainly to wrap some unmanaged C++ code so the code
can be used from C# via a DLL. My unmanaged code can throw some
exceptions (unmanaged exception class).
My question is, can the methods of the managed class try and catch the
unmanaged exceptions? That is, could I write something like this in a
managed class method:
try
{
native->foo();
}
catch( NativeException e)
{
...
}
If not, I guess I need to move the native exception handling down into
the unmanaged classes?