Re: [fpc-pascal] Question about interfaces and patch

2005-03-26 Thread ml
Quoting Thomas Schatzl <[EMAIL PROTECTED]>: > Hello, > > note in advance: if I mention CORBA interfaces, I actually mean "CORBA > style" or Java/.net like interfaces (which are not real CORBA interfaces > anyway) in the following (too lazy to do a search&replace or find > another term). > > [E

Re: [fpc-pascal] Question about interfaces and patch

2005-03-26 Thread Thomas Schatzl
Hello, note in advance: if I mention CORBA interfaces, I actually mean "CORBA style" or Java/.net like interfaces (which are not real CORBA interfaces anyway) in the following (too lazy to do a search&replace or find another term). [EMAIL PROTECTED] schrieb: ml schrieb: Hmmm, Delphi gives a compil

Re: [fpc-pascal] Question about interfaces and patch

2005-03-25 Thread ml
Quoting Thomas Schatzl <[EMAIL PROTECTED]>: > Hello, > > ml schrieb: > Hmmm, Delphi gives a compile time error if "as" is used on an interface > without GUID, same for support()... since both use the interfaces IID to > query for existence of an interface (either directly or via > QueryInterf

Re: [fpc-pascal] Question about interfaces and patch

2005-03-25 Thread Thomas Schatzl
Hello, ml schrieb: I made one wrong statement. It's not "as" that doesn't work. getinterfaceentry works only for interfaces that have guid specified. By default guid is zeroed, and getinterfaceentry just returns first interface in table, which means wrong. Same problem shows in Support too. Hmmm, D

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
I made one wrong statement. It's not "as" that doesn't work. getinterfaceentry works only for interfaces that have guid specified. By default guid is zeroed, and getinterfaceentry just returns first interface in table, which means wrong. Same problem shows in Support too. writing guid like ['{000

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Marcel Martin
Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: procedure MyXYZPart.DoReport(aRep: IReportable); begin if (aRep <> nil) then begin if (aRep is ILogged) then (aRep as ILogged).Log(aRep.Report) else aRep.Report end; I see what you want, but if you would do pr

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
> 1. and what I would like is just a lot cleaner and readable code of > this. > 2. Before you tell how to do something at least test and look your > solution > 2.1. Because queryinterface doesn't work in fpc as it should you always > get first vmt and if you do a queryinterface you don't work with

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 21:21 +0100, Michael Van Canneyt wrote: > OK, now I see where you're going. > > Your last sentence means: I want DoReport to accept only an 'IReportable' > But at the same time, your code is checking that behind 'IReportable' > there is also an 'ILogged'. > > I find this a

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: [Cut] > > > > > > procedure MyXYZPart.DoReport(aRep: IReportable); > > > begin > > > if (aRep <> nil) then begin > > >if (aRep is ILogged) then > > > (aRep as ILogged).Log(aRep.Report) > > >else > > > aRep.Report > > > end; > > > > I see what you

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 15:01 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005, ml wrote: > > > On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > >> > >> On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > >>> > > >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 14:37 +, memsom wrote: > Sorry to be late in the conversation... > > >> Here is a simple example how it should be used > >> > >> type > >> IReportable = interface > >>function Report: string; > >>// let's say that this should write report and > >>// return st

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
Sorry to be late in the conversation... >> Here is a simple example how it should be used >> >> type >> IReportable = interface >>function Report: string; >>// let's say that this should write report and >>// return status description as string >> end; >> >> ILogged = interface >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 20

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > > > Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > > > >> > >> > >> On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Marco van de Voort <[EMAIL PROTECTED]>: > >>> >

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 2005, ml wrote: // than one interface a := (object as IA); // correct b := (object as IB); //

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread ml
Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > > > On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: > > > Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > > >>> On Tue, 22 Mar 2005, ml wrote: > // than one interface > a := (object as IA); // correct > b := (object as IB); //

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread Michael Van Canneyt
On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 2005, ml wrote: // than one interface a := (object as IA); // correct b := (object as IB); // returns pointer to the first interface vmt=IA c := (object as IC); // returns pointer to the

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread ml
Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > On Tue, 22 Mar 2005, ml wrote: > > > // than one interface > > > a := (object as IA); // correct > > > b := (object as IB); // returns pointer to the first interface vmt=IA > > > c := (object as IC); // returns pointer to the first interface v