[fpc-pascal] Illegal type conversion: "LongInt" to "TObject"

2010-01-27 Thread Graeme Geldenhuys
Hi, If I compile the code snippet shown below in 'mode delphi' it works fine. If I try and compile it with 'mode objfpc' it fails with a compiler error as shown here: /home/graemeg/programming/personal/fpginstall/src/rttihelpers.pas(156,43) Error: Illegal type conversion: "LongInt" to "TObject"

Re: [fpc-pascal] OOP and XML usage

2010-01-27 Thread Anthony Walter
I've written some XML classes which expose themselves as interfaces. Usage goes something like this: procedure SaveSettings(const Settings: string); var Document: IDocument; Filer: IFiler; begin Document := CreateDocument; Filer := Document.ForceRoot('test') as IFiler; Filer.WriteTime('t

Re: [fpc-pascal] OOP and XML usage

2010-01-27 Thread Jorge Aldo G. de F. Junior
i dont like this way of working with XML files... im creating my own model using an Class factory and RTTI properties. you register your classes in the class factory and the XML loader uses a class function to select wich one to create for a given node. This lets you have a lot more control over

Re: [fpc-pascal] How to use a window message queue in a call?

2010-01-27 Thread Anthony Walter
>>     SetWindowLong(Wnd, GWL_USERDATA, Integer(BaseWindow)); > > Not 64-bits safe. An integer is not a long.  Ptruint probably. Ah well, there is a new API to fix this in 64 bit Windows. Use SetWindowLongPtr/GetWindowLongPtr instead. ___ fpc-pascal mail

Re: [fpc-pascal] How to use a window message queue in a call?

2010-01-27 Thread Marco van de Voort
In our previous episode, Anthony Walter said: > BaseWindow := CreationWindow; > BaseWindow.FHandle := Wnd; > SetWindowLong(Wnd, GWL_USERDATA, Integer(BaseWindow)); Not 64-bits safe. An integer is not a long. Ptruint probably. ___ fpc-pascal

Re: [fpc-pascal] How to use a window message queue in a call?

2010-01-27 Thread Anthony Walter
As Michael Van Canneyt says, you cannot use a method as a window message handler. This assumed implicit Self variable will most likely break the return pointer on the stack. Here is my code for a user defined window class. Note, window messages are processed through TObject.Dispatch threadvar

Re: [fpc-pascal] OOP and XML usage

2010-01-27 Thread Leonardo M . Ramé
I use a similar approach in a systems integration product for a hospital, it communicates different systems by XML files. The app receives an XML with data related to an radiology study, then parses the file and convert it to an object, do some checkings and transformations, and store the object

[fpc-pascal] initial implementation of TConnectionLIst

2010-01-27 Thread ik
ׁHello List, I've uploaded a very initial version of my TConnectionList manager for Database to github: http://github.com/ik5/TConnectionList Please note that the code is in it's very early stages and I have not even wrote a single testing line for it, and I'm going to rename the class to TDBConn

Re: [fpc-pascal] How to use a window message queue in a call?

2010-01-27 Thread Michael Van Canneyt
On Wed, 27 Jan 2010, Daniel Gilbert wrote: Hi there, this is my first posting to the fpc-mailinglist, so please don't slap me if I do anything wrong. :) I'm currently re-writing a program I've written in Delphi some months ago. Due to the now missing free version, I've decided to switch ov

[fpc-pascal] How to use a window message queue in a call?

2010-01-27 Thread Daniel Gilbert
Hi there, this is my first posting to the fpc-mailinglist, so please don't slap me if I do anything wrong. :) I'm currently re-writing a program I've written in Delphi some months ago. Due to the now missing free version, I've decided to switch over to Freepascal. But now, I'm somehow stuck.

Re: [fpc-pascal] OOP and XML usage

2010-01-27 Thread Graeme Geldenhuys
Michael Van Canneyt wrote: > > Yes. > I use DOM to read the file, and then translate the found TDOMElement nodes to > the actual business classes. Thanks for the quick response. I'm glad I am on the right track and my idea is not totally dumb founded. :) Regards, - Graeme - -- fpGUI Toolki

Re: [fpc-pascal] OOP and XML usage

2010-01-27 Thread Michael Van Canneyt
On Wed, 27 Jan 2010, Graeme Geldenhuys wrote: Hi, The small project I am working on requires reading a XML file and using that data for various things, including building a GUI interface. Most of my projects are database driven and uses the tiOPF framework to do my load/saving work (plus a l

[fpc-pascal] OOP and XML usage

2010-01-27 Thread Graeme Geldenhuys
Hi, The small project I am working on requires reading a XML file and using that data for various things, including building a GUI interface. Most of my projects are database driven and uses the tiOPF framework to do my load/saving work (plus a lot of other things). As the title says, all my app