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

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.
 
C

Carl Scarlett

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.
 
C

Carl Scarlett

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top