[fpc-devel] {$Interfaces Corba} and TInterfacedObject
Thorsten Engler
thorsten.engler at gmx.net
Thu Nov 29 12:19:16 CET 2007
> I then wrote the following code to see if I could query for a
> supported interface.
>
> ...
> Well, the 'It worked' never appears and the cmd.Execute is
> never fired, so it's still a mystery how CORBA interfaces
> work. I'll see if Delphi help maybe mentions something.
You can assign from an object to a (non-COM) interface variable:
var
Obj: TSomeObject;
Intf: ISomeInterface;
begin
...
Intf := Obj as ISomeInterface;
But once you got a (non-COM) interface you are stuck with it. As there is no
"QueryInterface" method available there is no way to get from an interface
to another interface implemented by the same object (Or back to the object
for that matter).
As for why your call to Supports fails, Supports internally gets Iinterface
(if implemented) from the object and then calls QueryInterface to get a
reference to the interface you actually asked for. That naturally only works
with COM interfaces.
Cheers,
Thorsten
More information about the fpc-devel
mailing list