[Lazarus] embedding fomrs into forms

Marc Santhoff M.Santhoff at t-online.de
Tue May 20 00:46:11 CEST 2008


Am Montag, den 19.05.2008, 19:58 +0200 schrieb Mattias Gaertner:
> 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. 

That part is clearly described in the wiki.

> 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.

I see. Thanks for being verbose.

> > > > 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.

Okay, so I can only reject that idea. My knowledge of such internals is
too small to take that risk.

> > > 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.

Not very attractive regarding lazarus itself ...

>  Probably someone must provide a bounty.

Maybe next time. Even if I would, the time frame for waiting on this
feature and the risk with new implementations would both be too big.

I'll have to try to convince anybody involved that "change concept" is
better than "use java" then. :(

Thanks for making things clear,
Marc

-- 
I am Microsoft of Borg. Resistance izkxGPF 0x5654 8820
Application RESIST.EXE has performed an illegal operation and will be
shut down.




More information about the Lazarus mailing list