#1 2017-04-29 18:28:41

Michael
Member
Registered: 2017-04-29
Posts: 1

Interfaces IS and AS

How do we use IS and AS with CORBA interface?

I can't get them to work like normal COM interfaces do.

The documentation seems to indicate they are the same.

What am I missing?

Offline

#2 2017-04-30 18:12:04

rcyboom
Member
Registered: 2017-04-29
Posts: 7

Re: Interfaces IS and AS

About is and as, I think the difference is as follows :
v:=obj is TObj   (true)  ; v:=obj is TOtherObj (false)
v:= obj as TObj (v is a instance of TObj class ) ; v:= obj as TOtherObj (v is nil )

if TObj and TOtherObj has a same of parent class:
v:=obj is TParent  (true)  ; v:=obj is TParent (true)

v:= obj as TParent (v is a instance of TParent class ) ; v:= obj as TParent (v is a instance of TParent class )

Offline

#3 2017-04-30 18:44:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,622
Website

Re: Interfaces IS and AS

FPC's CORBA interfaces are identified by string, not by GUID, and are not reference-counted.
So they are not supported by the framework.

When working with interfaces, use IInvokable root type, on all platforms.
This is not COM interfaces, but COM-compatible interfaces on Windows, and COM-like interfaces on Linux/Posix.

Offline

Board footer

Powered by FluxBB