Solved

Making Usable DLLs

Posted on 1998-09-13
1
139 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
ID: 1434657
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

831 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