[fpc-pascal] Corba Interfaces and IInterface query

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Nov 14 11:52:49 CET 2010


Hi,

Below is an example of two interfaces I declared. Trying to implement
them on a TObject subclass, I got a compiler error that IUnkown was
not implemented in my subclass. In all units I defined {$interfaces
corba}

Eventually I found out that I had to remove the (IInterface) heritage
from my interface definitions. Why is IInterface bound to IIUnknown
(aka COM interfaces)? In Delphi 7+ and Kylix, IInterface was not a COM
interface, so I would have expected that to be usable in CORBA
interfaces in FPC too, but apparently not.  So what's the point of
having IInterface then if it is always bound to COM? In that case,
simply defined your interfaces from IUnkown as per the COM spec.


------------------------------------------------------------------
unit layout_interface;

{$mode objfpc}{$h+}
{$interfaces corba}

interface

uses
  Classes, fpg_base;

type
  ILayoutManager = interface; // forward declaration


  ILayoutManaged = interface(IInterface)
  ['{05680C87-FD6A-4E41-84CE-ADD66DB60F8E}']
    function  GetLayoutManager: ILayoutManager;
  	procedure SetLayout(ALayout: ILayoutManager);
  	property  Layout: ILayoutManager read GetLayoutManager;
  end;


  ILayoutManager = interface(IInterface)
  ['{91FF6CE0-3B18-470A-BBCF-476064891EE4}']
    procedure AddWidget(AWidget: TfpgWindowBase);
    procedure AddLayout(ALayout: ILayoutManager);
  end;


implementation

end.
------------------------------------------------------------------


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/



More information about the fpc-pascal mailing list