Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

Create DLL with VB5

How an I create a NORMAL (not ActiveX) DLL with VB5.0 EE?


Declare MyFun lib "xxx.dll" (x as xxx) as xxx
in the declaration part of my module

xxx = MyFun(x)

to be the only lines of code I need to write to get the function working.
  • 2
  • 2
1 Solution
It is not possible to create a "classic" DLL under VB5.

You could create an OLE 2 Server exporting classes, and within those classes, showing your functions.

I will find a sample and post it for you.
NB : I have a sample, you can find it on my web site : 

Download the Gradient TitleBar. It is a complete VB Source code implementing gradient in the titlebar.

It is in fact an Active DLL exporting a class (class_TitleBar).
In the sample, we add a reference to this Active DLL, and in code, we create a variable of this class :
   Private m_cT As New class_TitleBar

After that, you can call functions inside :
   m_cT.Picture = picLogo
   m_cT.GradientForm Me

You can call this DLL from every langage supporting OLE2 (Delphi, Office, Powerbuilder...). One restriction is that you need to install the Runtime DLL of VB5
It is not possible with VB (waty's example is an activex dll).
However, there is an application that will allow you to write true dlls using a BASIC syntax.  Check out PB/DLL from power basic (
EWWW Stay away, FAR AWAY, from Powerbasic.  It's unstable, and produces DLLs that are unstable.
I would except the GFA Basic no longer exists (in the US, at any rate).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now