Suppose I have a COM object created on an MTA thread (i.e., initialized with CoInitializeEx(NULL, COINIT_MULTITHREADED)). I would like to use said object from some other, arbitrary, thread. For instance, from the thread pool. Since I don’t own this thread, I cannot call CoInitializeEx on it, so technically I cannot use COM. I’ve seen other ..
I am struggling with COM functions returning RPC_E_DISCONNECTED intermittently when performing cross apartment function calls from a client to a COM server. Most of the time, the problematic calls returns S_OK as expected, but once in a while, we get the RPC_E_DISCONNECTED error. This happens in a native C++ application with two single threaded apartments ..