Re: Interface Question



<alanglloyd@xxxxxxx> wrote in message
news:1160399795.029907.21900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[...]
I can understand how a Delphi classtype can readily implememnt
multiple interfaces, but this is an MS interface, does the same
thing happen there.

The question is more the other way around, I think - not that it
matters. Delphi objects were carefully engineered to have interfaces
be COM-compatible. So my guess is that the same things do happen
internally to a large extent, and if there are any differences,
they don't matter externally.


And how does one know (except by trial & error, or rumour) that
an interface implements multiple interfaces. Or is that hidden in
^^^^^^^^^
Not an interface, an object. The difference is important. An
interface can be implemented by many objects, and you never know
what other interfaces any object implements. Except in the normal
case when you do, or at least have a good idea.


MS exotic information. It doesn't appear to be in MSDN.

This would be published in the component's documentation. In some
cases, that might then be considered proprietary information not to
be released to the public. (Would type libraries have this information?)


I can see that a multiple-interface class-type could have its
Delphically-overridden QueryInterface method set up a pseudo-VMT for a
typecast interface which has been implemented. The whole problem seems
to me to be the knowledge of an object's multiple interfaces. But I
suppose that if its _not_ a multiple interface implementing object,
then QueryInterface returns an error.

QueryInterface does not set up any tables; that happens at compile time
and it only returns pointers and status codes. The status code may
indicate that the requested interface is not supported.

TObject.QueryInterface is implemented in terms of TObject.GetInterface,
which is implemented in terms of the class method
TObject.GetInterfaceEntry, which uses TObject.GetInterfaceTable. That
bottoms out by reading from the VMT.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: Interfaces vs Classes
    ... it requires an extra level of indirection. ... >>I don't believe coding it the interface way is any readable or elegant. ... > very clear what any one caller actually needs. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: usbser.sys
    ... configuration, you need to select the interface you want (if the desired ... interface is an alternate setting). ... there anything else i need to change for it to support multiple interfaces. ... > Is there anything I need to do for CDC compliant devices specifically? ...
    (microsoft.public.development.device.drivers)
  • Re: Interface Design And Scalability
    ... I keep reading that I ... Coclass carries state and can implement one ... Interface is just a set of functions (hopefully ... One coclass can implement multiple interfaces, that is, provide multiple ...
    (microsoft.public.vc.atl)
  • Re: Examples of USB devices
    ... I don't claim to be a USB expert, but having multiple interfaces can ... the interface is defined so that the OS supplied driver can be ... >I am trying to understand and justify the complex flexibility in USB> standard for device detection. ...
    (microsoft.public.development.device.drivers)
  • Re: Who could tell me about CComQIPtr
    ... I write codes using vc6. ... I write codes of COM client using CComQIPtr,Look: ... Every interface implements ... so you never have to QueryInterface for ...
    (microsoft.public.vc.atl)