Solved

Writing DLL using VB 5.0

Posted on 1998-10-08
6
345 Views
Last Modified: 2012-05-04
I know the concept behind DLL's. But i have no idea of how to write a DLL. How to write a DLL using VB 5.0. Can anyone explain with a step by step example
0
Comment
Question by:raguram
6 Comments
 
LVL 2

Expert Comment

by:shchuka
ID: 1438809
The "normal" way a DLL works is it contains functions and/or procedures to be executed when called from any windows program.  With VB you cannot write such DLL's without resorting to third party products.  There's one called VB-DLL, but I never tried it.

What you can create in VB is ActiveX DLL - that is an OLE automation server.  Moreover, I've tried using these ActiveX DLL's from languages other than VB - and I failed miserably. I will strongly recommend C or C++ for writing DLL's to be used with VB.

-Aleks.
0
 

Expert Comment

by:analiafri
ID: 1438810
I have written ActiveX DLL's in VB5 and I succed. The steps you need to go on are the following:
1. Yo need to define the functionality you want your Dll will provide.
2. You need to design the object model to implement that functionality (clases, properties and methods).
3. You need to create a new proyect in VB5 and set in the proyect properties window, the proyect type to "Activex DLL".
4. You need to create the clases with the properties and methods for each class and codify them.
5. Yo can now compile thas proyect and you will have your Dll.

To can find good information about the detail of creating activex DLL's in the Visual Basic Books OnLine in "Component Tools Guide", "Creating Activex Component", "Creating Activex DLL".

Good Luck. Sorry about my inglish.
0
 

Author Comment

by:raguram
ID: 1438811
If normal DLL's can't be created thru' VB then what does it mean that we can create  ActiveX DLL.  Whats the difference between the normal DLL's and ActiveX DLL ? Where will this be used ? Basically i need this since i am working on IBM DB2(database) and for creating stored procedures i need to create DLLs. I have no experience in VC++ and moreover the front end is VB 5.0.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 3

Expert Comment

by:kfrick
ID: 1438812
Search for the "Thing Demo" in the on-line documentation. Print it out so you can make notes, then perform the exercise. This gives a good understanding of ActiveX Control creation. Don't worry about not understanding it at first, just follow the steps described...you will have a good overview when the demo is completed!
Good Luck!
-kf

0
 
LVL 2

Accepted Solution

by:
shchuka earned 50 total points
ID: 1438813
"Normal" DLL simply contains a bunch of functions and or procedures; you can call any of them to do some computations/whatever and return result.  These are the ones that you are using by doing
    declare function whatever lib "whatever" (whatever) as whatever
You cannot create these ones with VB without third party tools (they do exist, I saw some of them).

ActiveX DLL, which you can't create with VB, doesn't have separate functions/procedures - instead it contains an Object.  This objects will have properties and methods. Once you have this DLL, you can create an instance of this object, then you can access its properties and execute methods.  You would normally use
   CreateObject()
function to instantiate an object contained in ActiveX DLL.  Analiafri explained reasonably well the steps needed to create an ActiveX DLL.  Note though that ActiveX DLL can't do much more than a VB application can.  If you decided to use DLL's because you can't do something in VB, then ActiveX DLL may not of much help at all.

Hope, this clarifies things,
-Aleks.
0
 

Author Comment

by:raguram
ID: 1438814
Can you give me URL where i can get the online documentation for writing ActiveX EXE,ActiveX DLL and ActiveX Controls.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

813 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

10 Experts available now in Live!

Get 1:1 Help Now