Getting RPC_E_WRONG_THREAD when calling the call back method on the .Net object from the native C++
Hi,
I am getting below error when I call the call back method on the .Net CLR object interface from a C++ application.
"RPC_E_WRONG_THREAD The application called an interface that was marshalled for a different thread."
I get the .Net object interface as a parameter from a 3rd party .Net component, then I marshal this interface in C++ by calling "CoMarshalInterThreadInterfaceInStream" to use this .Net object in the newly created thread in my C++ application. And in the thread function, I un marshal the .Net object by calling the "CoGetInterfaceAndReleaseStream". Marshaling and Un Marshaling is working fine, but when I call the .Net object interface function from the thread, it return the "RPC_E_WRONG_THREAD" error.
Please let me know how can I fix this issue.