Solved

Creating DLL's With VB5.0

Posted on 1998-12-25
3
268 Views
Last Modified: 2010-05-03
lets say that for an example I want a dll, with a sub that generates a beep, which I can call by the following line:

private declare sub beepme lib "mydll.dll"

and then, when clicking on a button:

private sub command1.click()
   beepme
end sub

how would I create such a DLL?????

I have VB5.0 Entreprise Edition

By the way, when i choose 'new project' it says 'active X DLL', not an 'average' DLL. Is That OK???
0
Comment
Question by:fax
3 Comments
 

Accepted Solution

by:
Aum earned 100 total points
ID: 1452479
Active X DLL is not a regular DLL. Regular DLLs you cannot do with VB. You need C/C++, Assembler, Delphi... for that. But then there's PowerBasic/DLL. This is a commercial product, around $180 I think, of which you may find more information at http://www.powerbasic.com. From those who once wrote Borland's TurboBasic, now turned into the advanced PowerBasic for DOS. They have made several other products besides PowerBasic. One is PB/DLL, which comes in 2 fashions: version 2.0 (16 bits) and version 5.0 (32 bits). These may compile any VB program into small-sized true machine code that doesn't require any VB runtimes. They may also compile procedures into DLLs. Besides, they extend VB features by adding inline assembler, unions,... and a set of added functions (of which the ArraySort is most impressive). It's a well worth the money product for any VB professional programmer. Just check the site.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1452480
No, you can't do that. You have to do it this way:

Start VB
Select File, New Project, Select ActiveX DLL
Class1 will show. Paste this to Class1:

Option Explicit

Public Sub Beepme()
    Beep
End Sub

Now add new project - Standard EXE type.
Project2 will be added, default Form1 will show.
Set it As Startup Project (Right click in project explorer and select Set As Start Up)
In references (menu Project, References), add (check) "Project1"
Add command button to your form.
Paste this code to your form:
Option Explicit

Private Sub Command1_Click()
Dim oBeeper As New Project1.Class1
    oBeeper.Beepme
End Sub

It should beep!
0
 

Author Comment

by:fax
ID: 1452481
Well, thats kind of a bummer isn't it!

thnx anyway!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 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…

707 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

15 Experts available now in Live!

Get 1:1 Help Now