Solved

Creating DLL's With VB5.0

Posted on 1998-12-25
3
295 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 57
Put text in a picture ASP.NET C# 2 57
Access query that references subform 5 47
converting visio 2010 to powerpoint 2010  - formatting issues 5 72
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

803 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