Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-09

A list of CORBA interfaces - how?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I'm porting some of my old Delphi code which used interfaces extensively. Since I moved to FPC years ago, I liked the idea of CORBA-style interfaces, and mostly use them under FPC projects.

Anyway, some of my code used IInterfaceList / TInterfaceList, but that uses IIInterface, which is an alias for IUnknown, which is COM-style interfaces only.

What is the equivalent for CORBA style interfaces? Just a TList storing pointers?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Flávio Etrusco
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
Hi, I'm porting some of my old Delphi code which used interfaces extensively. Since I moved to FPC years ago, I liked the idea of CORBA-style interfaces, and mostly use them under FPC projects. Anyway, some of my code used IInterfaceList / TInterfaceList, but that uses IIInterface, which is an alias for IUnknown, which is COM-style interfaces only. What is the equivalent for CORBA style interfaces?  Just a TList storing pointers? Regards,  - Graeme - --

I've just found this: http://62.166.198.202/view.php?id=6036 And this really works! :) Even 'as' operator works (so the error message in FPC 2.4.4 is misleading).
You can iterate over TClass.GetInferfaceTable, and if you declare an interface name it'll appear there (I checked). Not sure whether there's some way (or hack) to compare an (unnamed) interface with the VMT pointer there...

Best regards,
Flávio

PS. A few days ago when Marcos Douglas was asking about CORBA vs COM I didn't find this information :-/

Flávio Etrusco
to Flávio Etrusco

Oops, seems I completely misread your post.
The problem is cite is the kind of (or exactly) the one you're trying to fix :-$

Thanks for Marcos for pointing that out.

-Flávio

2011/9/20 Flávio Etrusco :

Show quoted text 34 lines
On Tue, Sep 20, 2011 at 3:28 AM, Graeme Geldenhuys wrote: > Hi, > > I'm porting some of my old Delphi code which used interfaces > extensively. Since I moved to FPC years ago, I liked the idea of > CORBA-style interfaces, and mostly use them under FPC projects. > > Anyway, some of my code used IInterfaceList / TInterfaceList, but that > uses IIInterface, which is an alias for IUnknown, which is COM-style > interfaces only. > > What is the equivalent for CORBA style interfaces?  Just a TList storing > pointers? > > Regards, >  - Graeme - > > -- I've just found this: http://62.166.198.202/view.php?id=6036 And this really works! :) Even 'as' operator works (so the error message in FPC 2.4.4 is misleading). You can iterate over TClass.GetInferfaceTable, and if you declare an interface name it'll appear there (I checked). Not sure whether there's some way (or hack) to compare an (unnamed) interface with the VMT pointer there... Best regards, Flávio PS. A few days ago when Marcos Douglas was asking about CORBA vs COM I didn't find this information :-/