Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Making Usable DLLs

Posted on 1998-09-13
1
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses

610 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