what does “OLE The application called an interface that was marshalled for a different thread” after calling RevokeDragDrop mean?

柔情痞子 提交于 2019-12-11 09:51:58

问题


I'm still trying to figure out the answer to this question. I would appreciate a nudge in the right direction (since I have very little experience in OLE). Did anyone encounter a similar error after calling RevokDragDrop?

thanks,


回答1:


You passed marshaled interface into a different apartment. An attempt to call a method revealed this and the call aborted with this error RPC_E_WRONG_THREAD.

You should be careful using interface pointers on multiple threads. If you intend to use a pointer that you already hold from a different thread, you have to think it over whether you are allowed to or you need explicitly marshal/unmarshal the pointer for such use, e.g. with CoMarshalInterThreadInterfaceInStream function.

I suppose that the source of the problem is GetProp/SetProp API used. Those store raw pointers as they are without marshaling necessary on the way.



来源:https://stackoverflow.com/questions/10721269/what-does-ole-the-application-called-an-interface-that-was-marshalled-for-a-dif

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!