CreateDispatch给出“未找到组件” [英] CreateDispatch giving "Component not found"

查看:77
本文介绍了CreateDispatch给出“未找到组件”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是VC ++自动化概念的新手。我正在使用VC ++ 6.0,我的一个应用程序执行正常。但我不知道到底发生了什么,CreateDispatch()正在创建一个错误。它的失败和未找到组件是错误消息。



Hello, I am new to VC++ automation concept. I am using VC++ 6.0 and one of my application was executing fine. But I dont know what exactly happened and the CreateDispatch() is creating an error. Its failing and "component not found" is the error message.

if(a.CreateDispatch("Cognitive.a")) //Creates an IDispatch interface object and attaches it to the COleDispatchDriver object.
{
//code
}
else
AfxMessageBox("Cognitive.a component not found");





请帮我解决。



Pls help me out.

推荐答案

将指针传递给 COleException 对象 CreateDispatch()获取详细的错误信息,如 MSDN [ ^ ]。这不应该从VC 6开始改变。但是你应该在VC 6文档中查找相同内容。
Pass a pointer to a COleException object to CreateDispatch() to get detailed error information as shown in the MSDN[^]. This should not have changed since VC 6. But you should lookup the same in the VC 6 documentation.


Cognitive.a应该是你想要的对象的编程标识符为...创建IDispatch接口。如果这段代码多年来一直有效,而且突然间它不会超过我认为在你进行这个调用时不再有Cognitive.a对象。如果不了解更多有关环境和应用的信息,很难说出是什么原因以及如何解决这个问题。因此,请查看您在配置和已安装的OLE组件中所做的任何更改。
"Cognitive.a" is supposed to be the programmatic identifier of the object that you want to create the IDispatch interface for. If this code worked since years and all of a sudden it does no longer than I would assume that there is no longer a "Cognitive.a" object around at the time you make this call. It is hard to tell for what reason and how to solve that without knowing more about the environment and application. So look for any changes you made in your configuration and installed OLE components.


我在初始化时再添加一行



I added one more line while initialization

const IID DIID__IRecognitionEvents = {0x229C1071,0x829F,0x11D2,{0xBA,0x6E,0x00,0x00,0xE8,0xD9,0xFD,0xF6}};







我在互联网上找到它。它的工作正常。但究竟这条线路究竟是什么,我不明白。如果有人知道这条线在做什么,请帮助我。



谢谢。




I found it on internet. Its working fine. But what exactly is this line doing I dont understand. If anybody knows what this line is doing pls help me.

Thank you.


这篇关于CreateDispatch给出“未找到组件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆