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
-
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
You can't call CoInitializeEx with COINIT_MULTITHREADED if it's already been called with a different threading model specified. I don't believe the DAO library is thread safe. In order to access DAO from multiple threads, you'll have to create your own free threaded object wrapping whatever DAO calls you need, and syncronizing access to the DAO library. Mark