Neven commented:

> Funny thing is Aaron that Combo does implememt IUnknown (as it
> implements IanInterface) so
>
> var
>   interface: IanInterface;
>
> IanInterface := Combo;
>
> compiles OK but 'as' doesn't!

The internal implementation of the 'as' operator relies on an interface
having a GUID defined for that interface, whereas the programatic
assignment simply modifies the VMT pointer to the appropiate interface
section of itself via compiler magic and assigns that.

If you haven't defined a GUID for your interface then the above behaviour
will occur. I discovered this the hard way, and thought that you should
know. If you already have a GUID then something wierd is happening and
more debugging will be necessary 8-)

Cheers, Max.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to