Connect to external InProc Server ?
-
Hi, I want to subscribe to events from an in process ATL COM object. This object is instantiated in a seperate process. I know the code I'm using to generate the events is working properly, but I don't know how to 'grab' the correct instance of the COM component so I can receive these events. If I call CoCreateInstance, I'm creating a new seperate instance of the same object. How do I retrieve the running instance of an inprocess COM object ? Is this possible ? Is there some example code I can look at ? Mark
-
Hi, I want to subscribe to events from an in process ATL COM object. This object is instantiated in a seperate process. I know the code I'm using to generate the events is working properly, but I don't know how to 'grab' the correct instance of the COM component so I can receive these events. If I call CoCreateInstance, I'm creating a new seperate instance of the same object. How do I retrieve the running instance of an inprocess COM object ? Is this possible ? Is there some example code I can look at ? Mark
I know only one way how to solve your problem here. You have a choise to create an out-of-process COM object and make just a single instance of it in the memory. That means by any calling of CoCreateInstance(..) you connect just to that single instance of your COM object. For creation of a single instance in Visual C++ ATL you can use a macro: DECLARE_CLASSFACTORY_SINGLETON( CMyCass ) Jawid
-
Hi, I want to subscribe to events from an in process ATL COM object. This object is instantiated in a seperate process. I know the code I'm using to generate the events is working properly, but I don't know how to 'grab' the correct instance of the COM component so I can receive these events. If I call CoCreateInstance, I'm creating a new seperate instance of the same object. How do I retrieve the running instance of an inprocess COM object ? Is this possible ? Is there some example code I can look at ? Mark