Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing Extensible programs (plugins) with COM and VB

Status
Not open for further replies.

sbrassard

Programmer
Oct 23, 2002
2
0
0
US
I want to write a program that supports feature A B & C.
Then in the future, an unknown feature D is required. If I can learn how to write the program to be extensible, then D should just plugin and the rest of the program can use it as if it was always there.

But how do I accomplish this? I would like to have a WinAmp type plugin framework. In other words, if I was the end user of a piece of software, I just want to download a particular plugin (extension to the software), drop it into a folder and voila! It automatically works with the software.

How can I go about achieving this type of modularity and design without the need for a user to worry about registering the DLL plugin?

Any help would GREATLY be appreciated! Please, if anyone has some example code please supply it.

 
the DLL will always need to be registered. COM is based off the actual Component being registered.

Here is an example

An application whats to use libraryX.ObjectY.
The object is looked up in the registry.
The location of the object is found (this could be a DLL or a remote application)
The DLL is either loaded into the client address space or the object is activated via DCOM.


So what do you need to do for your plugins to work? Well one thing is you could have your app search for plugins and register them (exe's are self registering by just running them).
Your app would have to be able to identify what objects are plugins some how.
All programming would have to be done late binding (obviously since your app at the time of compiling didn't know about object D sinse it didn't exsist)

You can think of OCX's and Insertable objects in VB as pluggins. They are COM objects that have been registered on the system. If a OCX hasn't been registered then it will not be available despite being on the file system even in the windows directories. But VB does let you pick a file. What this actually does though is registers that file at that point.

What language are you planning on using?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top