Click here to Skip to main content
15,907,874 members
Home / Discussions / COM
   

COM

 
QuestionHow to Get property value if it returns BSTR Pin
Inam23-Feb-04 20:33
Inam23-Feb-04 20:33 
AnswerRe: How to Get property value if it returns BSTR Pin
safee ullah23-Feb-04 23:41
safee ullah23-Feb-04 23:41 
GeneralRe: How to Get property value if it returns BSTR Pin
Inam24-Feb-04 17:26
Inam24-Feb-04 17:26 
GeneralRe: How to Get property value if it returns BSTR Pin
Steve S25-Feb-04 5:52
Steve S25-Feb-04 5:52 
Generalregsvr32 Pin
crewchill23-Feb-04 16:22
crewchill23-Feb-04 16:22 
GeneralFinalize CD via IMAPI Pin
ig_ab23-Feb-04 5:51
ig_ab23-Feb-04 5:51 
GeneralqueryInterface Pin
waliop23-Feb-04 0:57
waliop23-Feb-04 0:57 
GeneralRe: queryInterface Pin
Steve S23-Feb-04 2:18
Steve S23-Feb-04 2:18 
QueryInterface is a discovery mechanism. Let's say you have an interface (any interface, it doesn't matter) to a COM component. You can, using a method in the interface, ask the component if it supports another interface that you know about.

For instance, you might have an IFrooble interface on an object, and you want to know if it supports automation using the 'classic IDispatch' method.

You say something like:

HRESULT hr;
IDispatch* pDisp = NULL;
hr = pFrooble->QueryInterface( IID_IDispatch, reinterpret_cast<void**>(&pDisp));

if (SUCCEEDED(hr))
{
// Yep, it does dispatch, and we now have that interface as well
// as the IFrooble one.
}
else
{
// No, it doesn't or can't provide that interface
}


Does that help?

Another scenario is versioned interfaces, where a client will ask for successive interfaces (eg IFooBar4, IFooBar3, IFooBar2, IFooBar) until it gets one it's happy with.

Steve S
GeneralRe: queryInterface Pin
Big_M24-Feb-04 1:24
Big_M24-Feb-04 1:24 
GeneralCOM DLL Pin
waliop23-Feb-04 0:55
waliop23-Feb-04 0:55 
GeneralRe: COM DLL Pin
Steve S23-Feb-04 2:11
Steve S23-Feb-04 2:11 
QuestionHow can I create a COM hook like DrCOM Monitor? Pin
kenokabe22-Feb-04 21:05
kenokabe22-Feb-04 21:05 
Generaloutlook embedding Pin
emmatty21-Feb-04 23:13
emmatty21-Feb-04 23:13 
GeneralOutlook Addin Pin
chakkaradeepcc19-Feb-04 23:56
chakkaradeepcc19-Feb-04 23:56 
GeneralBSTR * parameter Pin
dzsigit19-Feb-04 0:26
dzsigit19-Feb-04 0:26 
GeneralRe: BSTR * parameter Pin
Steve S19-Feb-04 1:06
Steve S19-Feb-04 1:06 
GeneralRe: BSTR * parameter Pin
dzsigit19-Feb-04 3:52
dzsigit19-Feb-04 3:52 
GeneralRe: BSTR * parameter Pin
Vi219-Feb-04 18:58
Vi219-Feb-04 18:58 
GeneralRe: BSTR * parameter Pin
Steve S19-Feb-04 22:50
Steve S19-Feb-04 22:50 
GeneralRe: BSTR * parameter Pin
dzsigit19-Feb-04 23:01
dzsigit19-Feb-04 23:01 
GeneralRe: BSTR * parameter Pin
Vi220-Feb-04 0:29
Vi220-Feb-04 0:29 
GeneralRe: BSTR * parameter Pin
dzsigit20-Feb-04 2:38
dzsigit20-Feb-04 2:38 
GeneralRe: BSTR * parameter Pin
Steve S22-Feb-04 22:19
Steve S22-Feb-04 22:19 
GeneralRe: BSTR * parameter Pin
dzsigit23-Feb-04 1:05
dzsigit23-Feb-04 1:05 
GeneralRe: BSTR * parameter Pin
Steve S23-Feb-04 2:08
Steve S23-Feb-04 2:08 

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.