[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Harold

7/26/2004 10:25:00 PM

My app is using:
Dim obj As System.runtime.Remoting.ObjectHandle =
System.Activator.CreateInstanceFrom()
oApp = CType(obj.Unwrap, someObject)

To create an object in a different assembly. This works great. However, I
would like my app to handle any unhandled exceptions generated in oApp. I
have added handlers for Application.ThreadException and
AppDomain.CurrentDomain.UnhandledException for my app, but these do not get
called when the error is raised.

Can someone help me understand the concept of handling exceptions from
objects created this way? Is the object considered to be in the same
AppDomain? On the same Thread?

Thanks,
Harold



1 Answer

Sam Santiago

7/27/2004 5:27:00 AM

0

I would try to keep it simple by wrapping your code that invokes remote
objects in a Try..Catch block. You can catch RemotingExceptions and any
others your objects throw. The UnhandleException should be the absolute
last line of defense. Your application should have some exception handling
throughout. Check out this link that has tons of information on exception
handling. Some topics that might be of interest to you in this link are the
sections on creating a base application exception class and a custom
remoting exception:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/except...

Good luck.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com

"Harold" <hwh@jttb.com> wrote in message
news:O6w9Z91cEHA.3148@TK2MSFTNGP10.phx.gbl...
> My app is using:
> Dim obj As System.runtime.Remoting.ObjectHandle =
> System.Activator.CreateInstanceFrom()
> oApp = CType(obj.Unwrap, someObject)
>
> To create an object in a different assembly. This works great. However,
I
> would like my app to handle any unhandled exceptions generated in oApp. I
> have added handlers for Application.ThreadException and
> AppDomain.CurrentDomain.UnhandledException for my app, but these do not
get
> called when the error is raised.
>
> Can someone help me understand the concept of handling exceptions from
> objects created this way? Is the object considered to be in the same
> AppDomain? On the same Thread?
>
> Thanks,
> Harold
>
>
>