Singleton implementation over multiple instances of one DLL (copy) ?

L

Lothar Behrens

Hi,

I have a class (called pluginmanager) that gets loaded indirectly by
an assembly loaded with a call to LoadFrom.
On the other hand I use operator new on other plugins, that are
directly known in my test project.

So i mix the way of creation of objects.

How do I avoid using a new instance from a 'local' DLL when the plugin
DLL is already loaded ?
(The local DLL may reside in the test application that uses this
mixture)

The plugin DLL is at a known place.

Are there any solutions ?

Thanks, Lothar
 
M

Mubashir Khan

cant u use the singleton pattern .... private constructor ... public
GetInstance method ..... etc ......
 
L

Lothar Behrens

Mubashir said:
cant u use the singleton pattern .... private constructor ... public
GetInstance method ..... etc ......

This didn't solve my main problem.

Dim o as MyClass = MyClass.GetInstance() usually creates an instance
form
the same physical DLL.

But there is already an instance from a copy of the DLL.

I want to reuse the yet loaded version.

Any ideas ?

Lothar
 

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