?
Solved

Plugins for VB programs...

Posted on 1999-12-16
6
Medium Priority
?
275 Views
Last Modified: 2013-11-18
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...

Thanks,
Erik
0
Comment
Question by:Calistair
  • 3
  • 3
6 Comments
 

Author Comment

by:Calistair
ID: 2286526
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.
0
 
LVL 1

Expert Comment

by:zivf
ID: 2286795
Are you asking about some built-in visual basic feature?
0
 

Author Comment

by:Calistair
ID: 2287284
No no, I'm asking about making plugins for VB projects...
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 1

Accepted Solution

by:
zivf earned 600 total points
ID: 2287376
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?
0
 
LVL 1

Expert Comment

by:zivf
ID: 2287381
the CreateObject function is part of the VBA library rather the VB library.
0
 

Author Comment

by:Calistair
ID: 2288630
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! :)
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question