Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Jonas Maebe
Michael Van Canneyt wrote on Wed, 25 May 2016: On Wed, 25 May 2016, Jonas Maebe wrote: Sven Barth wrote on Wed, 25 May 2016: An method pointer is always automatically constructed by the compiler consisting of the address of the method (here IFPReportFilter.RenderReport) and the instance

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Michael Van Canneyt
On Wed, 25 May 2016, Jonas Maebe wrote: Sven Barth wrote on Wed, 25 May 2016: An method pointer is always automatically constructed by the compiler consisting of the address of the method (here IFPReportFilter.RenderReport) and the instance that method belongs to (in this case the

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Paul Breneman
On 05/25/2016 09:56 AM, Bo Berglund wrote: On Wed, 25 May 2016 08:21:54 -0500, Paul Breneman wrote: You've probably considered Abbrevia: http://wiki.lazarus.freepascal.org/FreePascalArchivePackage Yes, I got that as a suggestion over at the Embarcadero forum...

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Graeme Geldenhuys
On 2016-05-25 13:32, Jonas Maebe wrote: > It works by design. Excellent, thanks for confirming that. Regards, Graeme ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Graeme Geldenhuys
On 2016-05-25 13:31, Sven Barth wrote: > that contains the pointer to the method as well as what is going to be > loaded as "Self" (the data part Michael mentioned) Thanks for explaining it Sven. Regards, Graeme ___ fpc-pascal maillist -

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Bo Berglund
On Wed, 25 May 2016 08:21:54 -0500, Paul Breneman wrote: >You've probably considered Abbrevia: >http://wiki.lazarus.freepascal.org/FreePascalArchivePackage > Yes, I got that as a suggestion over at the Embarcadero forum... But when I downloaded it from Sourceforge it

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Bo Berglund
On Wed, 25 May 2016 21:59:21 +0100, Graeme Geldenhuys wrote: >On 2016-05-25 15:58, Paul Breneman wrote: >> so >> if you can figure out what part to use it should work good in Delphi and >> FPC. > >I can confirm Abbrevia worked well for a Delphi/FPC project I

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Graeme Geldenhuys
On 2016-05-25 15:58, Paul Breneman wrote: > so > if you can figure out what part to use it should work good in Delphi and > FPC. I can confirm Abbrevia worked well for a Delphi/FPC project I worked on a couple years ago. I also don't recall it being difficult to use. Regards, Graeme --

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Marco van de Voort
In our previous episode, Bo Berglund said: > over to FPC on the RPi and compile there. > So I need a zipper that can be used in both ends and since D2007 does > not come with one built in but FPC does (paszlib), I figured I could > copy the src dir from FPC over to Delphi and use that to compress

[fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Bo Berglund
I have a project that is targeting both Linux (on Raspberry Pi) and Windows. It started in Delphi 2007 and is a command line utility. It needs to use some zip compression of binary files, which must be readable both by the programs and the standard tools (WinZip etc). I am going to finish the

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Michael Van Canneyt
On Wed, 25 May 2016, Graeme Geldenhuys wrote: Hi, Can I safely assign a method from an Interface reference to an event handler. The code below works, but I'm not sure if it is safe to do so, and allowed. == TTestApp = class(TObject) private rpt:

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Sven Barth
Am 25.05.2016 13:54 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2016-05-25 12:18, Michael Van Canneyt wrote: > > I am not sure this is safe to do, since an event handler exists of 2 > > pointers: data and method. As far as I know, an interface does not have a > > data

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Graeme Geldenhuys
On 2016-05-25 12:18, Michael Van Canneyt wrote: > I am not sure this is safe to do, since an event handler exists of 2 > pointers: data and method. As far as I know, an interface does not have a > data pointer. I don't fully understand your statement about 2 pointers? An event handler is simply a

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Jonas Maebe
Sven Barth wrote on Wed, 25 May 2016: An method pointer is always automatically constructed by the compiler consisting of the address of the method (here IFPReportFilter.RenderReport) and the instance that method belongs to (in this case the FReportFilter), so this will indeed work without

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Bo Berglund
On Wed, 25 May 2016 12:59:34 +0200 (CEST), mar...@stack.nl (Marco van de Voort) wrote: >I would look for a ZIP codebase based on top of the zlib stream >(TCompressionstream) interfaces. > >These exist both in Delphi and FPC. I checked in the D2007 help and it did show the TCompressionstream

Re: [fpc-pascal] Assigning Interface method to event handler

2016-05-25 Thread Sven Barth
Am 25.05.2016 13:18 schrieb "Michael Van Canneyt" : > > > > On Wed, 25 May 2016, Graeme Geldenhuys wrote: > >> Hi, >> >> Can I safely assign a method from an Interface reference to an event >> handler. The code below works, but I'm not sure if it is safe to do so, >> and

Re: [fpc-pascal] Using paszlib from fpc 3.0 with fpc and delphi 2007?

2016-05-25 Thread Paul Breneman
On 05/25/2016 03:00 AM, Bo Berglund wrote: I have a project that is targeting both Linux (on Raspberry Pi) and Windows. It started in Delphi 2007 and is a command line utility. It needs to use some zip compression of binary files, which must be readable both by the programs and the standard