Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-16 Thread Zaher Dirkey
On Thu, Apr 15, 2010 at 7:58 PM, Marc Weustink wrote: > Zaher Dirkey wrote: >> >> On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt >> wrote: >>> >>> {$INTERFACES CORBA} >> >> {$INTERFACES CORBA} >> >> It is resolved my problem, Is there any limit to use it (except it is >> not work in Delphi

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-16 Thread Graeme Geldenhuys
Extending the example program a but further to test for not supported interfaces I found that the cast (via as syntax) to get a interface gives a compiler error [test 3 it program]. Using supports() still worked though [test 4 in program]. Cheers, - Graeme - program interface_test; {$ifdef FPC

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-16 Thread Graeme Geldenhuys
Marc Weustink het geskryf: > > or functions like supports() (which uses queryinterface) Actually, that *does* work with FPC 2.4.0. See attached console application. I used supports() and a cast to get a Corba interface reference. It seems the compiler does some extra magic (probably with the GU

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-16 Thread Michael Van Canneyt
On Fri, 16 Apr 2010, Graeme Geldenhuys wrote: Marc Weustink het geskryf: You cannot use casts like var a: IMyObject; b: IMyOtherObject; begin b := a as IMyOtherObject; or functions like supports() (which uses queryinterface) I remember reading something about this a year or two ag

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Graeme Geldenhuys
Marc Weustink het geskryf: > You cannot use casts like > var >a: IMyObject; >b: IMyOtherObject; > begin >b := a as IMyOtherObject; > > or functions like supports() (which uses queryinterface) I remember reading something about this a year or two ago in the mailing list. As far as I re

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Marc Weustink
Zaher Dirkey wrote: On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? You cannot use casts like var a: IMyObject; b: IMyOtherObject; begin b :

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Zaher Dirkey wrote: On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? Not that I know of :-) Michael. _

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Zaher Dirkey
On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: > {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? Thank for your replay. -- Zaher Dirkey ___ fpc-pascal m

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Zaher Dirkey wrote: IMyIntf = interface function GetValue: Variant; end; TMyObject=(TList, IMyIntf) end; Can not compile becuase it need to add this functions to TMyObject function QueryInterface(const iid : tguid;out obj) : longint;stdcall; funct

[fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Zaher Dirkey
IMyIntf = interface function GetValue: Variant; end; TMyObject=(TList, IMyIntf) end; Can not compile becuase it need to add this functions to TMyObject function QueryInterface(const iid : tguid;out obj) : longint;stdcall; function _AddRef : longint;stdcall; fu