Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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.
 
Share this answer
 
"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.
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900