Plugins for VB programs...

How would I be able to allow my program to use plugins? ie, the user gives the program a plugin's filename and the program incorporates it into itself...

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CalistairAuthor Commented:
The program I'm trying to write here is a File Transfer program, and I want it to be able to use plugins designed for it.
Are you asking about some built-in visual basic feature?
CalistairAuthor Commented:
No no, I'm asking about making plugins for VB projects...
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

You need to define an interface class, and the plugins will have to implement this class. The rest is simple:
1. The plug-in programmer should compile its plug-in as an ActiveX DLL, and provide you the name of the class he chose to implement you interface.
2. You should define a variable (let's call it objFTP) of type IYourInterface (the name of your interface). If you want the interace to use events, it should be a class or form module variable and declared WithEvents.
3. Point the variable to a new instance of the class using CreateObject function in the following way:
Set objFTP = VB.CreateObject("Mylib.MyClass")
4. Use the object you have just created using all methods, properties and events represented by the interface you have created.
any question?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
the CreateObject function is part of the VBA library rather the VB library.
CalistairAuthor Commented:
You are amazing! :) Thanks!! However, instead of declaring objFTP as an "interface class", it needs to be declared as type Object.

Thanks for the help, really! :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Components

From novice to tech pro — start learning today.