How to capture native exception?

  • Thread starter Thread starter Muhammad Arif
  • Start date Start date
M

Muhammad Arif

Dear All,

I am using an un-managed code in my VB.Net application and some times
a native exception occured which is not captured by the Try/Catch
block.
How I may capture the native exception?

Regards,
Muhammad Arif
 
Dear Chris,
Thanx for the reply .... but what is the solution of this problem. Any
alternated which may capture the native exception and prevent my
application to be crashed.

Regards,
Muhammad Arif
 
The "solution" is to make sure your native code handles all error
conditions. You shouldn't be throwing exceptions to external callers.

-Chris
 
Dear Chris,
The native code is provided by my vendor in the form of a dll and I
can't handle the exception in native code. Is it possible to do some
thing with my code to capture this exception.


Regards,
Muhammad Arif
 
Not that I'm aware of. The best you can do is to try to not pass data or
call methods during a time that might cause an exception. I'm very
surprised their DLL throws exceptions - I'd call that a bad design. You
might talk with the vendor and see what they suggest.

-Chris


Muhammad Arif said:
Dear Chris,
The native code is provided by my vendor in the form of a dll and I
can't handle the exception in native code. Is it possible to do some
thing with my code to capture this exception.


Regards,
Muhammad Arif



"Chris Tacke, eMVP" <ctacke[at]Open_NET_CF[dot]org> wrote in message
The "solution" is to make sure your native code handles all error
conditions. You shouldn't be throwing exceptions to external callers.

-Chris
 
Maybe you could write your own DLL which sets up exception handling for
unmanaged code and calls the real DLL on behalf of your managed code?

Paul T.

Chris Tacke said:
Not that I'm aware of. The best you can do is to try to not pass data or
call methods during a time that might cause an exception. I'm very
surprised their DLL throws exceptions - I'd call that a bad design. You
might talk with the vendor and see what they suggest.

-Chris


Muhammad Arif said:
Dear Chris,
The native code is provided by my vendor in the form of a dll and I
can't handle the exception in native code. Is it possible to do some
thing with my code to capture this exception.


Regards,
Muhammad Arif



"Chris Tacke, eMVP" <ctacke[at]Open_NET_CF[dot]org> wrote in message
The "solution" is to make sure your native code handles all error
conditions. You shouldn't be throwing exceptions to external callers.

-Chris


Dear Chris,
Thanx for the reply .... but what is the solution of this problem. Any
alternated which may capture the native exception and prevent my
application to be crashed.

Regards,
Muhammad Arif
 
Back
Top