> Hi folks,
> I hope I got the right forum for this: im a developer of a new
> open-source project (http://threedsia.sourceforge.net) and have a problem
> writing plug-ins:
> Because we want to use mainly C++ as language I'd like to have C++ plug-ins, or
> at least user C++ classes. While we already wrote some plug-ins with C and they
> worked fine, I renamed a working plug-in from textonlyFrontEnd.c to *.cpp,
> forcing make to use g++ as compiler. Compiles fine, but the resulting library
> can't be accessed with dlsym... I already consulted what-ever-doc-I-could-find,
> but I've not a suitable solution.
> Thnx for any information,
> Marc Haisenko
1. Define the abstraction of what you expect your plugins to support.
2. Include in the shared library ( I assume ) a extern "C" factory
method for the plugin implementation.
3. The user specifies the library, you load and test for the common
factory method and viola!
For a general idea of what I mean:
// ----------------------------------------------
// In your engine/framework/application/whatever
// ----------------------------------------------
class AbstractPluginInterface
{
public:
//
// Bunch of pure virtuals, or virtuals with implementation
//
class PluginLoaderQuote:};
//...
AbstractPluginInterface *loadPlugin( pluginIdentifier )
{
// load the library identified
// resolve address of "createPlugin"
// invoke the factory method
return (*createFunc)();
}
//----------------------Quote:};
class PlugInImplementation : public AbstractPluginInterface
{
public:
//
// Implementations of pure virtual or handled interface
//
extern "C"Quote:};
AbstractPluginInterface *createPlugin(/* intialization stuff if
needed */)
{
return new PlugInImplementation(...);
}
--Quote:}
Best Regards
Jeff Koftinoff
Does anyone know if Netscape supports plug-ins on AIX? I've a feeling
last time I asked the question they didn't and now they might.
RSVP if you are in the know,
alan
-----------------------------------------------------------------------
Alan Donovan, FORE Audio & Video, 14 Regent Street, Cambridge CB2 1DB
-----------------------------------------------------------------------
4. Always put Oracle in a zone?
5. Reward for NExS Spreadsheet Plug-Ins
6. serial 'laplink' between 2 PC unusable !
7. Netscape helpers and plug-ins, also java help
8. ramdisk
9. List of plug-ins for linux/netscape please!
10. Browser Question (Plug-ins) m-w.com
13. Acrobat Reader 4.0 MIME Type for Netscape plug-ins