I'm having a problem here obviously.. I have a dll and an application using it, which needs to insert an object instance in a list in the dll through a function like:
The IVolatileResource class is a base class which my objects derive from. Now the problem is that if i allocate the object IN that function, everything is ok, but if I allocate it outside the dll, using AddObject (new CMyObject), where CMyObject derives from volatileresource class, when I delete the object created in the manager's destructor, the debugger says that it cannot access that memory in the heap. It is important that I pass the object that way. Is there any workaround?
IVolatileResource* CResourceManager::AddObject (IVolatileResource *pObj)