Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: Mephisto on October 03, 2004, 10:50 PM

Title: Creating a Plugin System
Post by: Mephisto on October 03, 2004, 10:50 PM
Does anyone here have any links to tutorials or information regarding this creating/implementing a plugin system, both creating the plugins and the system for the plugins.  Thanks to anyone who provides.  :)
Title: Re: Creating a Plugin System
Post by: MyndFyre on October 04, 2004, 03:42 AM
Quote from: Mephisto on October 03, 2004, 10:50 PM
Does anyone here have any links to tutorials or information regarding this creating/implementing a plugin system, both creating the plugins and the system for the plugins.  Thanks to anyone who provides.  :)

You should be more specific.  What kind of plugins are we talking about (for example, something core/essential to the product or extra features, such as a primary protocol vs. a protocol extension)?  What platforms are you targetting?  Etc.
Title: Re: Creating a Plugin System
Post by: Mephisto on October 04, 2004, 09:21 AM
Win32, extensions for the program (the plugins are not the program's core), and general tutorials on creating plugins.  I have a general idea on how to develop them, but I haven't been able to find any decent resources on creating them, nor example programs.
Title: Re: Creating a Plugin System
Post by: Grok on October 04, 2004, 11:32 AM
You could study COM or CORBA, both which implement a style of plugin.  Once you get the big picture you could use that knowledge to design your own system.  Generally, though, it is better to use an existing well-defined interface system than to roll your own.
Title: Re: Creating a Plugin System
Post by: Mephisto on October 04, 2004, 12:54 PM
Quote from: Grok on October 04, 2004, 11:32 AM
You could study COM or CORBA, both which implement a style of plugin.  Once you get the big picture you could use that knowledge to design your own system.  Generally, though, it is better to use an existing well-defined interface system than to roll your own.

Are these already created systems free and avaliable to the public?  If so, do you know where I could attain one?
Title: Re: Creating a Plugin System
Post by: MyndFyre on October 04, 2004, 02:19 PM
Quote from: Mephisto on October 04, 2004, 12:54 PM
Quote from: Grok on October 04, 2004, 11:32 AM
You could study COM or CORBA, both which implement a style of plugin.  Once you get the big picture you could use that knowledge to design your own system.  Generally, though, it is better to use an existing well-defined interface system than to roll your own.

Are these already created systems free and avaliable to the public?  If so, do you know where I could attain one?

COM is part of Visual C++, implemented generally in the Active Template Library (ATL).
Title: Re: Creating a Plugin System
Post by: Skywing on October 04, 2004, 02:34 PM
Quote from: Grok on October 04, 2004, 11:32 AM
You could study COM or CORBA, both which implement a style of plugin.  Once you get the big picture you could use that knowledge to design your own system.  Generally, though, it is better to use an existing well-defined interface system than to roll your own.
Note that COM is extremely painful to use from a language that doesn't have built-in support for it (e.g. VB, C#, ...).
Title: Re: Creating a Plugin System
Post by: Banana fanna fo fanna on October 04, 2004, 02:36 PM
I had to do a ton of webcam/directshow COM programming, and let me tell you, it SUCKS. It's mainly a documentation issue, though.
Title: Re: Creating a Plugin System
Post by: Grok on October 04, 2004, 04:10 PM
Quote from: Banana fanna fo fanna on October 04, 2004, 02:36 PM
I had to do a ton of webcam/directshow COM programming, and let me tell you, it SUCKS. It's mainly a documentation issue, though.

A particular implementation of a library is way off topic to whether COM or CORBA is a suitable plugin platform.
Title: Re: Creating a Plugin System
Post by: Grok on October 04, 2004, 04:20 PM
Quote from: Skywing on October 04, 2004, 02:34 PM
Quote from: Grok on October 04, 2004, 11:32 AM
You could study COM or CORBA, both which implement a style of plugin.  Once you get the big picture you could use that knowledge to design your own system.  Generally, though, it is better to use an existing well-defined interface system than to roll your own.
Note that COM is extremely painful to use from a language that doesn't have built-in support for it (e.g. VB, C#, ...).

Probably.  Now that I think about it, COM or CORBA might not be an answer to the question.  COM/CORBA are designed to provide self-describing interfaces between unfamiliar code objects.

Now I think the request was to provide a well-known interface, so COM might only be an available mechanism, not a predefined interface.  If he wants a well-known plugin interface, I do not have an answer for him.  Does he want one with callbacks?
Title: Re: Creating a Plugin System
Post by: MyndFyre on October 04, 2004, 04:43 PM
Quote from: Skywing on October 04, 2004, 02:34 PM
Note that COM is extremely painful to use from a language that doesn't have built-in support for it (e.g. VB, C#, ...).

I thought VB *does* have built-in support via ActiveX.  I could be off.  But VB7 and C# do have nearly-built-in support via RCWs.  All you have to do is import it into your VS.NET project, or use the command-line tool to generate an assembly.
Title: Re: Creating a Plugin System
Post by: Skywing on October 04, 2004, 11:03 PM
Quote from: MyndFyre on October 04, 2004, 04:43 PM
Quote from: Skywing on October 04, 2004, 02:34 PM
Note that COM is extremely painful to use from a language that doesn't have built-in support for it (e.g. VB, C#, ...).

I thought VB *does* have built-in support via ActiveX.  I could be off.  But VB7 and C# do have nearly-built-in support via RCWs.  All you have to do is import it into your VS.NET project, or use the command-line tool to generate an assembly.
Rephrasing:

Note that COM is extremely painful to use from a language that doesn't have built-in support for it (like for instance VB and C# do).
Title: Re: Creating a Plugin System
Post by: Banana fanna fo fanna on October 05, 2004, 07:43 PM
Is COM available for Linux?
Title: Re: Creating a Plugin System
Post by: thetempest on October 13, 2004, 10:09 AM
COM is just "C Object Modle" I fogot what C stands for, anyways, the methodolgy is easy to do on linux...

the problem, i dont think you can get your COM to work with M$.  I used to do COM but it's been a while.

Sorry, wish i could be of more help, if i get some freetime, i'll see what i can digup.

Good luck
Title: Re: Creating a Plugin System
Post by: MyndFyre on October 13, 2004, 01:56 PM
Quote from: thetempest on October 13, 2004, 10:09 AM
COM is just "C Object Modle" I fogot what C stands for, anyways, the methodolgy is easy to do on linux...

the problem, i dont think you can get your COM to work with M$.  I used to do COM but it's been a while.

Sorry, wish i could be of more help, if i get some freetime, i'll see what i can digup.

Good luck

COM is "Component Object Model".  COM is not available for Linux, unless it was implemented with Wine, which I highly doubt.  It's generally messy, a pain, and requires a lot of work; it's supposed to provide language interoperability.  I don't know what in hell you're talking about, tempest, with it working easily for Linux and not for Windows...
Title: Re: Creating a Plugin System
Post by: Skywing on October 13, 2004, 05:22 PM
There was at one time COM for UNIX like there was IE for UNIX...