Question on Coinitialize
Posted: Thu 07 Jul 2005 12:43
I have a service application, that creates a thread (A) to perform some business logic, which in turn creates thread (B), that holds a TMSConnection and TMSQuery. Thread (B) will execute whatever query thread (A) requires, and when done, goes into a suspended state until (A) either terminates it or gives it another query.
The problem now is that sometimes, (B) never returns from running its query. Using Profiler, I can see that the query completed on SQL Server's side, but in my app, the Execute method never returns.
Now, in thread (A), I need to call CoInitializeEx(nil, COINIT_MULTITHREADED). In thread (B), do I still need to call CoInitialize(nil), though it does not seem to make a difference.
Any suggestions? Thanks.
Ray Mond
The problem now is that sometimes, (B) never returns from running its query. Using Profiler, I can see that the query completed on SQL Server's side, but in my app, the Execute method never returns.
Now, in thread (A), I need to call CoInitializeEx(nil, COINIT_MULTITHREADED). In thread (B), do I still need to call CoInitialize(nil), though it does not seem to make a difference.
Any suggestions? Thanks.
Ray Mond