Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Writing DLL using VB 5.0

Posted on 1998-10-08
6
Medium Priority
?
401 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
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!

 
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 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

916 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