Solved

Making Usable DLLs

Posted on 1998-09-13
1
140 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 62
Paint/Redraw window while dragging 16 82
VB6 ListBox Question 4 48
Inserting a datasheet query into the body of an email using VBA? 4 11
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…
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.
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…

791 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