Click here to Skip to main content
15,905,508 members

Comments by Ganesamoorthy.S (Top 7 by date)

Ganesamoorthy.S 28-Jan-11 7:01am View    
Accept Answer Reject Answer
.I have completed this on my own.

Adding interface to a COM, is as usual but if we suppose to use QUERYINTERFACE then it has to be implemented(implement interface option must be chosen). As you have instructed me in the threads it has to be inherited.

I did it and got the expected result.
Ganesamoorthy.S 28-Jan-11 7:00am View    
Accept Answer Reject Answer
.I have completed this on my own.

Adding interface to a COM, is as usual but if we suppose to use QUERYINTERFACE then it has to be implemented(implement interface option must be chosen).

I did it and got the expected result.
Ganesamoorthy.S 28-Jan-11 2:20am View    
<pre>HRESULT hr;
IGreet *greetObject;
IGreet2 *greetObject2;
CString strTemp;
hr = CoInitialize(NULL);
if (FAILED(hr) )
return ;
hr = CoCreateInstance(CLSID_Greet,NULL,CLSCTX_INPROC_SERVER, IID_IGreet,(void **)&greetObject);
if (FAILED(hr) )
{
CoUninitialize();
return ;
}
cout << greetObject->Sayhello("Ganesh") << endl;

hr = greetObject->QueryInterface(IID_IGreet2,(void **)&greetObject2);
if (FAILED(hr) )
{
CoUninitialize();
return ;
} </pre>
Ganesamoorthy.S 27-Jan-11 6:40am View    
Thanks a lot
Ganesamoorthy.S 27-Jan-11 6:31am View    
I am a beginner in COM, can you please clarify me?

I am using VS2005. How can i inherit the interface? Is there any wizard to do this?