I have a c++ DLL that uses an IDispatch interface to invoke methods on a third party DLL. It works if I invoke those methods from the original thread but if a new thread is started (not the one CoCreateInstance was called on) to invoke the method after the it throws a 0x800101E error is thrown. I also tried CoInitialize on the second thread without success.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
The error 0x8001010E is
RPC_E_WRONG_THREAD
"The application called an interface that was marshalled for a different thread.".You are breaking COM apartment rules and you are attempting to use an interface pointer on a thread that does not belong to apartment the pointer is valid for. To pass interface pointer to another apartment use marshaling.
See What is COM marshaling and how do I use it? and CoMarshalInterThreadInterfaceInStream function, and this Understanding The COM Single-Threaded Apartment.