Re: Interface Question
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 9 Oct 2006 17:46:02 +0200
<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
.
- References:
- Interface Question
- From: alanglloyd@xxxxxxx
- Re: Interface Question
- From: Maarten Wiltink
- Re: Interface Question
- From: alanglloyd@xxxxxxx
- Interface Question
- Prev by Date: Re: Interface Question
- Next by Date: Re: Interface Question
- Previous by thread: Re: Interface Question
- Next by thread: Re: Interface Question
- Index(es):
Relevant Pages
|