Here is my case.
In unmamaged code, I wrote code as,
RaiseException(MYEXCETIONTYPE, ....);
Thereafter the exception finally got caught by managed code, and was
wired up to a .NET Exception object, you know.
managed code,
try
{
NativeCall();
}
catch (Exception e)
{
e.ToString(); //..
}
My purpose is to tell if it's a custom exception or a system
exception, that depends on if it's a MYEXCETIONTYPE. Then the problem
is how could I get the ExceptionCode?
Thanks.
Laura T. - 16 May 2007 11:52 GMT
Maybe Marshal.GetExceptionCode() can do?
http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.marshal.
getexceptioncode(VS.80).aspx
> Here is my case.
>
[quoted text clipped - 20 lines]
> is how could I get the ExceptionCode?
> Thanks.
dotNeter - 17 May 2007 06:48 GMT
> Maybe Marshal.GetExceptionCode() can do?
>
[quoted text clipped - 26 lines]
>
> - Show quoted text -
Thanks. That works!!!
Phill W. - 17 May 2007 12:33 GMT
> In unmamaged code, I wrote code as,
> RaiseException(MYEXCETIONTYPE, ....);
> My purpose is to tell if it's a custom exception or a system
> exception, that depends on if it's a MYEXCETIONTYPE.
try
{
NativeCall();
}
catch (MYEXCETIONTYPE e)
{
e.ExceptionCode ...
}
catch (Exception e)
{
e.ToString();
}
HTH,
Phill W.