?
Solved

Making Usable DLLs

Posted on 1998-09-13
1
Medium Priority
?
164 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 90 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…
Suggested Courses

839 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