Solved

Making Usable DLLs

Posted on 1998-09-13
1
135 Views
Last Modified: 2011-08-18
I need to make some functions in my existing VB5 project into a DLL.  I haven't had any prior experience doing this so I just did a very simple DLL that has the function TestDLL and that has the line TestDLL = 100.  I successfully compiled the DLL.  
     Afterwards, I developed a simple project that will use/reference the DLL.  I browsed thru different folders to get to the DLL.  Why is it listed in References as Project1?
Do I need to have a declaration for the DLL just like I'm using a Windows developed DLL like USER32.DLL.  If so, how am I supposed to do this?  Can somebody give me a simple code for both the DLL and the project that will use the DLL for me to have a better understanding on this.
0
Comment
Question by:imby
1 Comment
 
LVL 2

Accepted Solution

by:
MelissaC earned 30 total points
Comment Utility
When you're compiling or running your DLL project, VB stores the DLL-classes in the registry, like this: Projectname.Classname.
The references in VB are read from the registry.
If you rename your project, you'll find the new name in the references-list.

When you use a DLL written by yourself, you only need to mark the DLL-classes you want to use in the references-list. Then you can say:
Dim myobject as new Projectname.Classname
Now you can start using the object, for example:
myobject.height=50

(I assume you know each DLL you write in VB can contain several classes. Each class is a component).
Hope this explanation is good enough.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now