Click here to Skip to main content
15,888,968 members
Home / Discussions / COM
   

COM

 
QuestionOPC connectivity problem : CoCreateInstance issue Pin
Neo Andreson18-Feb-11 2:24
Neo Andreson18-Feb-11 2:24 
AnswerRe: OPC connectivity problem : CoCreateInstance issue Pin
Randy Kondor19-Feb-11 14:37
Randy Kondor19-Feb-11 14:37 
Questionquestion about COM event handler Pin
asr112214-Feb-11 3:40
asr112214-Feb-11 3:40 
QuestionHow to get COM IID from a registered dll Pin
drakkor_111-Feb-11 13:22
drakkor_111-Feb-11 13:22 
AnswerRe: How to get COM IID from a registered dll Pin
drakkor_111-Feb-11 13:33
drakkor_111-Feb-11 13:33 
GeneralRe: How to get COM IID from a registered dll Pin
NedoRot14-Feb-11 2:32
NedoRot14-Feb-11 2:32 
QuestionIObjectWithSite - amidoinitrite? Pin
T800G2-Feb-11 10:53
T800G2-Feb-11 10:53 
QuestionPlz help with QueryInterface() [modified] Pin
Ganesamoorthy.S26-Jan-11 22:59
Ganesamoorthy.S26-Jan-11 22:59 
Hi All,

I have tried to use QueryInterface by using the following code segment.

The COM component had been created by me with two interfaces. The following code works fine with CoCreateInstance function.

When i try to obtain the another interface using "QueryInterface" returns E_NOINTERFACE. Frown | :(

Kindlly help me, by tracking mistake(s) if any.

Thanks,
Ganesamoorthy


    HRESULT hr;
IGreet *greetObject;
IGreet2 *greetObject2;
CString strTemp;
hr = CoInitialize(NULL);
if (FAILED(hr) )
    return ;
hr = CoCreateInstance(CLSID_Greet2,NULL,CLSCTX_INPROC_SERVER, IID_IGreet2,(void **)&greetObject2);
if (FAILED(hr) )
{
    CoUninitialize();
    return ;
}
greetObject2->AddRef();
cout << greetObject->Sayhello("Ganesh") << endl;
CComBSTR bstrVal, bstrVal1;

bstrVal1.Append ("Ganesh");
greetObject2->SayHello2(bstrVal1, &bstrVal);
strTemp.Format (_T("%s"), bstrVal);
MessageBox (strTemp);
hr = greetObject2-&gt;QueryInterface(IID_IGreet,(void **)&greetObject);
DWORD dw = GetLastError();
if (FAILED(hr) )
{
    CoUninitialize();
    return ;
}
CoUninitialize();


modified on Thursday, January 27, 2011 5:10 AM

AnswerRe: Plz help with QueryInterface() Pin
Yusuf27-Jan-11 1:02
Yusuf27-Jan-11 1:02 
QuestionCComContainedObject Question Pin
Craig Longman23-Jan-11 12:36
Craig Longman23-Jan-11 12:36 
QuestionProblem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit Pin
Aseem Sharma22-Dec-10 15:01
Aseem Sharma22-Dec-10 15:01 
AnswerRe: Problem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit Pin
ShilpiP22-Dec-10 21:38
ShilpiP22-Dec-10 21:38 
QuestionDifference between COM and DCOM Pin
tasumisra28-Nov-10 15:39
tasumisra28-Nov-10 15:39 
AnswerRe: Difference between COM and DCOM Pin
«_Superman_»29-Nov-10 8:20
professional«_Superman_»29-Nov-10 8:20 
AnswerRe: Difference between COM and DCOM Pin
Abhinav S16-Jan-11 3:11
Abhinav S16-Jan-11 3:11 
AnswerRe: Difference between COM and DCOM Pin
Shameel17-Aug-11 2:34
professionalShameel17-Aug-11 2:34 
Questionproblem with SafeArrayPutElement Pin
Member 444090525-Nov-10 17:22
Member 444090525-Nov-10 17:22 
AnswerRe: problem with SafeArrayPutElement Pin
T21021-Jan-11 1:49
T21021-Jan-11 1:49 
QuestionHow can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound13-Nov-10 3:52
glitteringsound13-Nov-10 3:52 
AnswerRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan13-Nov-10 7:06
mveRichard MacCutchan13-Nov-10 7:06 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound13-Nov-10 9:51
glitteringsound13-Nov-10 9:51 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan14-Nov-10 1:45
mveRichard MacCutchan14-Nov-10 1:45 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound14-Nov-10 3:52
glitteringsound14-Nov-10 3:52 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan14-Nov-10 4:23
mveRichard MacCutchan14-Nov-10 4:23 
QuestionCan we calculate/extract Virtual Table address some how from DIA SDK? Pin
glitteringsound4-Nov-10 12:30
glitteringsound4-Nov-10 12:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.