Get an instance of a .NET object in another .NET DLL

  • Thread starter Thread starter Carl Scarlett
  • Start date Start date
C

Carl Scarlett

Help.

I'm trying to get an instance of an object in another .NET DLL.

For example, application A is running and has an object "myObj" that has
been instanciated.
Application B want's to use the instance of myObj that has been instanciated
in application A.

In VB6, I could do a GetObject in Application B and it would give me myObj
from A.

How do I do it in .NET?

Carl.
 
Thanks for that.

I've been looking at the Reflection namespace, but can only create a new
instance of the object. What I want is to get an -existing- instance of the
object (so it's a singleton across both applications).

So far, all I've found that comes close is to use
System.Activator.CreateInstance. This creates a new instance though.

I've tried using System.Activator.GetObject, but there is no URL as I'm
only doing a client application.

Any more hints?

Carl.
 
I've been trying to understand Remoting but I'm getting a little lost. It
appears that remoting is the method used to gain access to my remote object,
but I'm finding it difficult to understand all the concepts. I guess VB6
hid a lot of this detail from me when I did a VB6 GetObject?

My real question is; Is it necessary to create a channel on my object? It
seems like overkill to pass serialised object info over a channel. Is this
the only way to get hold of my remote object?

Carl.
 
Back
Top