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
Jawid
Posts
-
Connect to external InProc Server ? -
need help for CoInitializeEx(..)Hi Guys, I have no idea what to do else with the implementation of CoInitializeEx( NULL, COINIT_MULTITHREADED) if I use it in the same process with MS DAO library. The problem appears when the CoInitializeEx(..) is already called and I try to open a database file using DAO functions. In that case that file is not going to open. But if I replace CoInitializeEx(..) by CoInitialize(0) it works fine and database file is opened. Best Regards, Jawid
-
How to use one instance of a COM object in different processes?Hi Guys, Thanks for great help. All of those advices seem very helpfull. I tried the solution with macro for singleton object and it works nice. Thanks,
-
How to use one instance of a COM object in different processes?Hi everyone, I am not able to find a way how to use the only one (common) instance of my COM object from several processes. Here I see the only solution of multiple instances and that way I lose some of the pointers. Can anybody guide me how to do that? Thanks, Jawid