Unhandled Exception in vc++ - HRESULT failed

久未见 提交于 2019-12-05 13:16:31

_com_issue_error() throws a _com_error exception that you are not catching. You need to wrap your code in a try/catch, eg:

try
{
    IModulePtr pI(__uuidof(RPTAModuleInterface));
    // ... 
}
catch(const _com_error& e)
{
    // e.Error() will return the HRESULT value
    // ...
}

Clearly CoCreateInstance() is failing. There is likely no library installed on the machine that registers the CoClass for RPTAModuleInterface, so it cannot be created. But you will have to look at the actual HRESULT to be sure why CoCreateInstance() is failing.

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