PC Review


Reply
Thread Tools Rate Thread

How to capture native exception?

 
 
Muhammad Arif
Guest
Posts: n/a
 
      21st May 2004
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
 
Reply With Quote
 
 
 
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      21st May 2004
Exceptions cannot be marshalled across the native/managed boundary.


--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



"Muhammad Arif" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Muhammad Arif
Guest
Posts: n/a
 
      24th May 2004
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


"Chris Tacke, eMVP" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Exceptions cannot be marshalled across the native/managed boundary.
>
>
> --
> Chris Tacke, eMVP
> Co-Founder and Advisory Board Member
> www.OpenNETCF.org
> ---
> ---
> Principal Partner
> OpenNETCF Consulting
> www.OpenNETCF.com

 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      24th May 2004
The "solution" is to make sure your native code handles all error
conditions. You shouldn't be throwing exceptions to external callers.

-Chris


"Muhammad Arif" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
> "Chris Tacke, eMVP" <(E-Mail Removed)> wrote in message

news:<(E-Mail Removed)>...
> > Exceptions cannot be marshalled across the native/managed boundary.
> >
> >
> > --
> > Chris Tacke, eMVP
> > Co-Founder and Advisory Board Member
> > www.OpenNETCF.org
> > ---
> > ---
> > Principal Partner
> > OpenNETCF Consulting
> > www.OpenNETCF.com



 
Reply With Quote
 
Muhammad Arif
Guest
Posts: n/a
 
      25th May 2004
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 news:<(E-Mail Removed)>...
> The "solution" is to make sure your native code handles all error
> conditions. You shouldn't be throwing exceptions to external callers.
>
> -Chris
>
>
> "Muhammad Arif" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >

 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      25th May 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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

news:<(E-Mail Removed)>...
> > The "solution" is to make sure your native code handles all error
> > conditions. You shouldn't be throwing exceptions to external callers.
> >
> > -Chris
> >
> >
> > "Muhammad Arif" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >



 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      25th May 2004
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, eMVP" <ctacke[at]Open_NET_CF[dot]org> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

> news:<(E-Mail Removed)>...
> > > The "solution" is to make sure your native code handles all error
> > > conditions. You shouldn't be throwing exceptions to external callers.
> > >
> > > -Chris
> > >
> > >
> > > "Muhammad Arif" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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
> > > >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Native Exception in netcfagl1_0.dll Chris Karcher Microsoft Dot NET Compact Framework 0 9th Oct 2007 05:46 AM
Native Exception on key press =?Utf-8?B?TXVydGh5?= Microsoft Dot NET Compact Framework 2 3rd Apr 2006 07:08 AM
native exception spiazzi Microsoft Dot NET Compact Framework 2 28th Oct 2005 03:51 PM
WMP Native Exception Brian Microsoft Dot NET Compact Framework 2 30th Dec 2003 06:00 PM
Re: A native exception occured. Hollywood Microsoft Dot NET Compact Framework 1 25th Jul 2003 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:59 PM.