错误 0x80010108(调用的对象已与其客户端断开连接)的原因可能是什么?

2022-01-14 00:00:00 com c++

在 C++ 程序中,调用 coclass 的方法返回错误 0x80010108(调用的对象已与其客户端断开连接).可能是什么原因造成的?

In C++ program the call to method of coclass returns the error 0x80010108 (The object invoked has disconnected from its clients). What may be the causes of that?

推荐答案

这是一个RPC错误,当你使用进程外COM时你会看到它.它告诉您服务器 .exe 停止运行.应该是被炸了或者即使仍然有活动的接口引用,也决定退出.那可能是引用计数问题.或不当使用 CAtlModule::Lock().等等,我只能猜测.使用 Tools + Attach to Process 调试服务器并找出它决定退出的原因.

It is an RPC error, you'll see it when you use out-of-process COM. It tells you that the server .exe stopped running. It probably bombed. Or decided to exit even though there were still active interface references. That could be a reference count problem. Or improper use of CAtlModule::Lock(). Etcetera, I can only guess. Debug the server with Tools + Attach to Process and find out why it decided to quit.

相关文章