Solved

Writing DLL using VB 5.0

Posted on 1998-10-08
6
316 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:kfrick
Comment Utility
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
Comment Utility
"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
Comment Utility
Can you give me URL where i can get the online documentation for writing ActiveX EXE,ActiveX DLL and ActiveX Controls.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now