Click here to Skip to main content
15,510,483 members
Home / Discussions / COM
   

COM

 
QuestionOPC connectivity problem : CoCreateInstance issue Pin
Neo Andreson18-Feb-11 3:24
Neo Andreson18-Feb-11 3:24 
AnswerRe: OPC connectivity problem : CoCreateInstance issue Pin
Randy Kondor19-Feb-11 15:37
Randy Kondor19-Feb-11 15:37 
Questionquestion about COM event handler Pin
asr112214-Feb-11 4:40
asr112214-Feb-11 4:40 
QuestionHow to get COM IID from a registered dll Pin
drakkor_111-Feb-11 14:22
drakkor_111-Feb-11 14:22 
AnswerRe: How to get COM IID from a registered dll Pin
drakkor_111-Feb-11 14:33
drakkor_111-Feb-11 14:33 
GeneralRe: How to get COM IID from a registered dll Pin
NedoRot14-Feb-11 3:32
NedoRot14-Feb-11 3:32 
QuestionIObjectWithSite - amidoinitrite? Pin
T800G2-Feb-11 11:53
T800G2-Feb-11 11:53 
QuestionPlz help with QueryInterface() [modified] Pin
Ganesamoorthy.S26-Jan-11 23:59
Ganesamoorthy.S26-Jan-11 23: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 2:02
Yusuf27-Jan-11 2:02 
QuestionCComContainedObject Question Pin
Craig Longman23-Jan-11 13:36
Craig Longman23-Jan-11 13:36 
QuestionProblem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit Pin
Aseem Sharma22-Dec-10 16:01
Aseem Sharma22-Dec-10 16:01 
AnswerRe: Problem in registering a 32 bit C++ COM/ATL Service on Windows7 64 bit Pin
ShilpiP22-Dec-10 22:38
ShilpiP22-Dec-10 22:38 
QuestionDifference between COM and DCOM Pin
tasumisra28-Nov-10 16:39
tasumisra28-Nov-10 16:39 
AnswerRe: Difference between COM and DCOM Pin
«_Superman_»29-Nov-10 9:20
professional«_Superman_»29-Nov-10 9:20 
AnswerRe: Difference between COM and DCOM Pin
Abhinav S16-Jan-11 4:11
Abhinav S16-Jan-11 4:11 
AnswerRe: Difference between COM and DCOM Pin
Shameel17-Aug-11 3:34
professionalShameel17-Aug-11 3:34 
Questionproblem with SafeArrayPutElement Pin
Member 444090525-Nov-10 18:22
Member 444090525-Nov-10 18:22 
AnswerRe: problem with SafeArrayPutElement Pin
T21021-Jan-11 2:49
T21021-Jan-11 2:49 
QuestionHow can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound13-Nov-10 4:52
glitteringsound13-Nov-10 4:52 
AnswerRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan13-Nov-10 8:06
mveRichard MacCutchan13-Nov-10 8:06 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound13-Nov-10 10:51
glitteringsound13-Nov-10 10:51 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan14-Nov-10 2:45
mveRichard MacCutchan14-Nov-10 2:45 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
glitteringsound14-Nov-10 4:52
glitteringsound14-Nov-10 4:52 
GeneralRe: How can I filter unwanted unwanted types(not in my code) from DIA SDK? Pin
Richard MacCutchan14-Nov-10 5:23
mveRichard MacCutchan14-Nov-10 5:23 
QuestionCan we calculate/extract Virtual Table address some how from DIA SDK? Pin
glitteringsound4-Nov-10 13:30
glitteringsound4-Nov-10 13: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.