[fpc-pascal]Mapping Object Pascal Classes to C++ Classes

Florian Klaempfl Florian.Klaempfl at gmx.de
Wed Nov 13 17:08:46 CET 2002


At 15:52 13.11.2002, you wrote:
>Hi All,
>
>I found an interesting articla written by Rudy Velthuis on the above subject.
>Take a look at:
>
>http://home.t-online.de/home/rvelthuis/cppobjs.htm
>
>It works in Delphi like a charm. Is this possible in FPC?? I don't have 
>FPC to
>hand to test it out.

I don't think so. I guess it works only because Borland C++ is used and 
Delphi and BC++ use the same
back end and probably a similiar VMT generation.

Further, these methods are limited: no multiple inheritance, no exceptions 
etc..
Its use depends on what you want to do.

Afaik you're one of the BeFPC people, right? If you want a clean mapping of 
the gui
classses from C++ to pascal, we can talk about C++ classes support in FPC 1.1.
The question is whether it is possible, it depends on the involved C++
language features.

E.g. if exceptions are used, things get rather complicated. In this
case I would suggest to modify h2pas to eat C++ and create wrappers as 
usual which do
the exception conversion.





More information about the fpc-pascal mailing list