B
Bret Pehrson
Suppose the following:
// Unmanaged code
class UnmanagedException /* not visible outside of unmanaged code */
{
};
void DoSomething() /* visible (exported) to managed code */
{
throw new UnmangedException();
}
// Managed code
// Call into unmanaged code
try
{
DoSomething();
}
catch (???)
{
}
What is/are suitable types to catch in the managed code?
I see SEHException and its parent ExternalException, but these (automatic)
wrappers seem to be based on COM hresult types of exceptions.
My understanding is that the managed framework automatically catches,
repackages, and rethrows the unmanaged exception, but as what?
Thanks
// Unmanaged code
class UnmanagedException /* not visible outside of unmanaged code */
{
};
void DoSomething() /* visible (exported) to managed code */
{
throw new UnmangedException();
}
// Managed code
// Call into unmanaged code
try
{
DoSomething();
}
catch (???)
{
}
What is/are suitable types to catch in the managed code?
I see SEHException and its parent ExternalException, but these (automatic)
wrappers seem to be based on COM hresult types of exceptions.
My understanding is that the managed framework automatically catches,
repackages, and rethrows the unmanaged exception, but as what?
Thanks