I have an ActiveX control that dynamically links to
another dll. This dll contains the following classes
which are defined in a cpp file (excuse the pseudo code):
MyObject * getObject(int index);
// Global static instance.
static MyObjectListMgr myObjectListMgr;
// In the same file another exposed class makes use of
// myObjectListMgr list this...
MyObject * myObject = myObjectListMgr.getObject(0);
myObject->m_refCount = myObject->m_refCount + 1;
My questions are:
* If two of my controls are loaded by one application,
or by two different applications, then will they both be
using the exact same instance of myObjectListMgr?
* Is this code thread-safe? If not, what are the
I'm using Visual C++ 6.0 by the way.