Re: QueryInterface mystery

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You clearly seem not to know anything about COM...
QueryInterface is the means for navigating among all interfaces
implemented on a COM object. It's fundamental in the sense
_all_ COM interfaces with no exceptions whatsoever support
it as part of their base interface IUnknown. There are important
rules a COM object must follow for implementing QueryInterface
and all COM clients rely on that. From the client perspective,
you may often not see QueryInterface in action as it is hidden
in smart pointers, but that doesn't diminish its fundamental role.

I highly suggest you read an introductory book on COM:

"Inside COM" by Dale Rogerson, MS Press

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"Dave" <dave5398@xxxxxxxxxxxxxx> wrote in message
news:OHlIWWg7HHA.980@xxxxxxxxxxxxxxxxxxxxxxx
Don't get QueryInterface at all! To use this you need a refid and a (void
**) ptr to something. All the code I've seen requires things like
IID_something or CLSID_somethingelse and the ptr has to be of a type
Isomeinterface. But of course all of this has to be DEFINED somewhere else
they are completely unknown to the compiler. That means headers and
static libraries but NOBODY tells you where to get them. How on earth do
you actually get interface pointers for a real interface???? On the other
hand, if you have all the headers and interfact pointers etc what do you
need QueryInterface for?

Dave



.



Relevant Pages

  • Re: Game object class design problem
    ... The COM and QueryInterface do work in C++ as a way to request ... interfaces, although COM is... ... happen to have a pointer to. ... I generally stick with using multiple inheritance. ...
    (rec.games.roguelike.development)
  • Re: QueryInterface fails (sometimes)
    ... The object inherits from 9 ... > QueryInterface (for one of the nine interfaces) fails when it is ran with ... > with IID_IUnknown, and perform a QueryInterface later, it works more ... > where it fails. ...
    (microsoft.public.win32.programmer.ole)
  • QueryInterface fails (sometimes)
    ... QueryInterface (for one of the nine interfaces) fails when it is ran with ... We also noticed that sometimes CreateInstance will fail when one of those ... with IID_IUnknown, and perform a QueryInterface later, it works more often. ... where it fails. ...
    (microsoft.public.win32.programmer.ole)
  • Re: How do I implement IAMStreamConfig in C++ ?
    ... QueryInterface I did some more reading. ... I'm lacking basic skills working with COM Interfaces, ... If you really want to learn the basics of COM, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Kernel includefile bug not fixed after a year :-(
    ... ipsec) code/interface wasn't mature and thus changed interfaces in the ... it from user space? ... be the case for all kernel headers. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)