Home All Groups Group Topic Archive Search About

Get Active Object from server

Author
3 Mar 2006 8:49 AM
HRsoft - Mark Scholten
Hi,

I have a problem with the Marshal.GetActiveObject() function. This is the
situtation.
I have a service running on my machine. That service creates a instance of a
class that is programmed using a singleton pattern.
Here is the code:
'Create new instance of the HRsync dll
Dim objFunctions As HRsync.Base.Functions.HRsyncFunctions
objFunctions = HRsync.Base.Functions.HRsyncFunctions.Instance

A new instance of my class will be created.
Now i start an other application on my machine that needs the instances I
just created on the server.
This is the code I use:

'Try to get an instance of the HRsync dll..
objFunctions =
Marshal.GetActiveObject("HRsync.Base.Functions.HRsyncFunctions")

But this code doesn't seem to work. I get this exception:
System.Runtime.InteropServices.COMException (0x800401E3): Operation
unavailable

What am I doning wrong? Or how can I accomplish my wish in an other way?
Thx!

AddThis Social Bookmark Button