You can create a pretty clean plugin system by making using of
polymorphism.

Make an abstract Plugin Class in a separate shared library. This library
will be used by both the application and all of the plugins. For each
plugin you need to create a separate shared library that has a class
inheriting from the abstract Plugin Class.

One of the virtual functions that you'll want in you abstract Plugin
Class will probably be.

virtual void attachTo( FXWindow *parentWin ) = 0;

Then your plugins will have to implement this function to attach
themselves to the application.

In order for the application to load the plugins, you'll need some way
to get an instance of the plugin. So in each plugins' library create a C
function:

Plugin *openPlugin( ) { return new myPlugin; }

The application then opens each plugin's shared library by name at
run-time, searches for the "openPlugin" function, calls it, and hangs
onto the returned handle. From then on, the application just calls the
virtual functions in the Plugin Class.

andrew

> hello everyone,
> 
> i want to use kind of plugins for my program. how could that be done
on
> unix/win32 in an easy way.
> 
> the plugins should contain foxgui elements and some other stuff, no
> multithreading is needed ...
> 
> any suggestions ?
> 
> answers could be a general as you want, its just to get an idea about
the
> problem.
> 
> regards
> 
> mathias
> 
