> 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

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to