[Lazarus] TFiler.DefineBinaryProperty ReadData size problem

brianwung at seed.net.tw brianwung at seed.net.tw
Tue May 20 08:26:53 CEST 2008


On Mon, 19 May 2008 12:54:45 +0200
Marc Santhoff <M.Santhoff at t-online.de> wrote:

> Am Montag, den 19.05.2008, 09:09 +0200 schrieb Marco van de Voort:
> > On Mon, May 19, 2008 at 12:06:40AM +0200, Marc Santhoff wrote:
> > > 
> > > > > My goal is to have a core programm and some additional parts
> > > > > delivered separately. Compiling the program for every
> > > > > permutation of combinations is not quite usable if the count
> > > > > of extras goes up.
> > > > 
> > > > Packages is the only long term way. Unless your interface
> > > > between the DLL and the program can be really limited and
> > > > rigid. Then you might have luck the manual way.
> > > 
> > > I don't understand, do you say, packages are dynamically
> > > loadable? I thought of them as statically linkable organizational
> > > containers.

Note:
The term 'package' has many meanings.
A 'lazarus package' is a set of files/directories with some extras
like compiler settings, output directory, i18n directory. It can be
used to compile ppus, or to compile a static or dynamic library.
A 'delphi package' is almost always a set of units with a dll (named
bpl) as target. It uses some compiler magic to allow sharing
classes/types and RTL between dynamic linked libraries.
FPC fully supports static libraries and 'normal' dynamic libs and
platform independently. But is does not yet provide the compiler magic
to share classes/types between dynamic libs. So, you can use the LCL as
static lib, but not as dynamic lib (at least not comfortable). When it
will, lazarus packages can be compiled to dynamic libs. It is possible
to do the magic manually, but it is complicated.


> > > If a user has installed the basic program, can I send him a
> > > package that can be loaded at statup extending the program?
> > 
> > Only by loadlibrary calls. (which must then be in the startup), and
> > of course the interface must be known. But in general yes.
> 
> The interface will be small and I'm free to define it at will. But
> that doesn't solve the problems using LCL in libraries, does it?
> 
> The wiki article about library packages showed that someone actually
> succeded in compiling the RTl to a dynlib, that may be woth a test
> (combined with loadlibrary).

Yes, it is possible with loadlibrary. But you also must call the
initialization/finalization sections manually of *all* used units in
the correct order.


> > Keep in mind that designtime packages are implemented using library
> > packages inside Delphi.  Delphi isn't recompiled for them :_)
> 
> Interesting, I stopped using Delphi shortly after version 3 was
> out. ;)

Keep in mind, that all dynamic libs must fit exactly. This means
every package must be compiled and provided for every supported
version. In case of Delphi this means a a new version every 1-3 years.
In case of lazarus/fpc it means several versions a year multiplied by
all supported platforms. And all the users that use snapshots or svn
must compile the packages anyway.
So dynamic libs are least useful for developers, which is why there is
not much done yet. Probably someone must provide a bounty.


Mattias



More information about the Lazarus mailing list