[fpc-pascal]plugin frameworks.

Carlo Kok ck at carlo-kok.com
Thu Jul 18 16:17:10 CEST 2002


----- Original Message -----
From: "Aitor SantamarĂ­a" <aitor.sm at wanadoo.es>
To: <fpc-pascal at deadlock.et.tudelft.nl>
Sent: Thursday, July 18, 2002 4:20 PM
Subject: Re: [fpc-pascal]plugin frameworks.


> Full_Name wrote:
>
> >Quoting Alan Grimes <alangrimes at starpower.net>:
> >
> >Take a look on Torry (www.torry.net) and search form 'plugin' (right
hand,
> >toppish corner.)
> >
> >If you're feeling lazy, this link is to the first freeware example with
source
> >on the list I got back:
> >
> >http://www.torry.net/samples/samples/plugins/plugin.zip
> >
> >I have no idea if it will help you, but I've looked at a lot of these,
and they
> >do merit some consideration.
> >
> Yes, they do. I overlooked it and got the idea. Now I have a question:
> what if the plug-in would want to use a function (better, an API) which
> lies in the main program?
> Would I have to pass an array of pointers to procedures/functions/vars
> from the main program to the plug-in? Any less-dirty idea?

Use a record like Winamp does:
type
  PPluginData = ^TPluginData;
  TPluginData = record
    PluginInterfaceVersion: Word;
    ShowMessageProc: procedure (msg: pchar);
  end;

> Maybe the answer to this question comes from: "how does GDI32.DLL do
> when it has to use KERNEL32.DLL functions? (from the SAME already loaded
> kernel, not from a new instance)" Anyone knows about this?

A dll is loaded only once per process.


Ck





More information about the fpc-pascal mailing list