[fpc-devel] {$Interfaces Corba} and TInterfacedObject

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Nov 29 11:52:06 CET 2007


On 29/11/2007, Joao Morais <post at joaomorais.com.br> wrote:
>
> >   ICommand = interface
>
> Under $interfaces com, interface = interface(iunknown)


That much I figured, but the question is what does 'interface' default
to if Corba style interfaces are used?


>
> 1. implement _addref, _release and QueryIntf if using com interfaces;
> 2. do nothing if using corba interfaces (I have no idea how an interface
> is "queried" here).

See, this is where the docs can do with some improvement.  :)  From my
bit of testing with Corba style interfaces, you can use the Supports()
method which internally uses the QueryInterface() method, so I would
imagine you at least need to implement QueryInterface in your own
custom interface enabled base class when using Corba style interfaces.

As for _addref() and _release(), it's still a mystery to me.  I would
imagine I don't need those, but then I have no idea what the base
interface looks like for Corba.  No documentation mentions wat it is!

>
> Any class. Afaik corba interfaces doesn't implement a method ?

It must, because I can query the interface using Supports().

> > Does FPC have a Non-Reference counted base class already?  It's quite
> > simple to implement you own, but is stupid if FPC doesn't already have
> > one.
>
> Err... a class doesn't have refcount, just start with TObject or a
> descendant.


I meant a class that supports interfaces.  TObject doesn't for COM.
Again, no idea for CORBA.


> You need. See eg MSE units.

MSEgui implements it's own custom TNullInterfacedObject class which
isn't reference counted with the usual IUnkown signature.  This is my
main question. What is the required functions for CORBA?  I know the
following is required for IUnkown.

  protected
    function QueryInterface(const IID: TGUID; out Obj): longint; stdcall;
    function _AddRef: longint; stdcall;
    function _Release: longint; stdcall;


>
> Not vague, they was straight to the point imo.
>

Could you then please point me to the correct documentation covering
all these questions. I can't seem to find that information anywhere.



Regards,
  - Graeme -


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



More information about the fpc-devel mailing list