Click here to Skip to main content
11,438,636 members (69,867 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC VC++
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 11-Jun-13 0:36am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

"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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.150506.1 | Last Updated 17 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100