God help me if I'm not using the right terms.
I am coding COM server plugins for an app that users load up in that app.
Users can load multiple instances of the same com server plug and they are created via ClassFactory.
I have a need to talk to these plugins from another "overseer" plugin in the same APP's process, so in the Create instance of the plugin as the app is creating instances of it's object I wish to send the resulting created object's pointer to the "overseer" plugin for later calling of this created object's methods, and it's other created instances methods. This works in so much as I am able to send the pointers over to the "overseer" plug and store them away but I have some questions as it's not all going as planned. First he code:
Here is where the object instance is created and a pointer to it (pbcrshimcontrol) assigned.
//////////////////////////////////////////////////////////////////////////////////
HRESULT CbcrshimcontrolFactory::CreateInstance( IUnknown* pUnkOuter, REFIID riid, void** ppv )
{
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
if (pUnkOuter != NULL)
return CLASS_E_NOAGGREGATION;
Cbcrshimcontrol* const pbcrshimcontrol = new Cbcrshimcontrol;
///////////////////////////////////////////////////////////////////////////////////
Here after getting a handle to the "overseer" plugin via standard LoadLibrary() and GetProcAddress() functions (Something I can do as there is only one instance of the "overseer" plugin), I send off the pointer to the newly created object to that "overseer" plugin.
//////////////////////////////////////////////////////////////////////////////////
uReturnVal=lpfnDllFunc1((int const)pbcrshimcontrol);
/////////////////////////////////////////////////////////////////////////////////
The pointers arrive and are called pObject
Now for my questions:
Over at the overseer plugin I have these pointers for each instance of the created plugin as desired. But because (I think), in the "overseer" plug I am in a different namespace, I cannot go: pObject->method. So I need help with that -or-
Maybe I send a pointer to just the method I wish to call but I cant seem to satisfy the VC 2008 compiler in any shape of:
uReturnVal=lpfnDllFunc1((int const)pbcrshimcontrol->method);
Which produces:
cannot convert from 'void (__thiscall Cbcrshimcontrol::* )(DWORD)' to 'int'
Or
uReturnVal=lpfnDllFunc1((int const)pbcrshimcontrol->(DWORD)MidiOutFromMaster);
Which produces:
'->Cbcrshimcontrol::Release' : left operand has '' type, use '.'
What I desire is, on the "overseer" plugin in the different namespace, to type
pObject-> and see all the methods I do over in the proper namespace or at least calling access to just one in particular.
I have been circling this tree barking up it for a couple days now so I need so help
Thanks in advance, I hope I was clear enough.
:Ron