COINIT_MULTITHREADED [英] COINIT_MULTITHREADED
问题描述
HRESULT hRes = CoInitializeEx(NULL,COINIT_MULTITHREADED);
HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
hres = 0x80010106设置后无法设置模式。我得到了。请允许 任何人都可以帮我解决错误。
hres=0x80010106 cannot mode set after it is set.error I got.Please can anyone help me to resolve the error.
推荐答案
您好PandyaChinna,
Hi PandyaChinna,
感谢您在此处发帖。
>> hres = 0x80010106设置后无法模式设置。我得到了。请允许 任何人都可以帮我解决错误。
此错误表示这不是第一次为线程设置并发模型的调用。
This error means this isn't the first call to set the concurrency model for a thread.
设置线程的并发模型后,无法更改。在先前初始化为多线程的公寓上调用CoInitialize将失败并返回RPC_E_CHANGED_MODE。
After the concurrency model for a thread is set, it couldn't be changed. A call to CoInitialize on an apartment that was previously initialized as multithreaded will fail and return RPC_E_CHANGED_MODE.
要在线程上正常关闭COM库,每次成功调用CoInitialize或CoInitializeEx(包括任何返回S_FALSE的调用)都必须通过对CoUninitialize的相应调用进行平衡。
To close the COM library gracefully on a thread, each successful call to CoInitialize or CoInitializeEx, including any call that returns S_FALSE, must be balanced by a corresponding call to CoUninitialize.
请检查您之前是否设置了并发模型。
Please check if you have set the concurrency model before.
希望这可以为您提供帮助。
Hope this could be help of you.
最诚挚的问候,
Baron Bi
这篇关于COINIT_MULTITHREADED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!