Solved

Creating DLL's With VB5.0

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
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…

914 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

20 Experts available now in Live!

Get 1:1 Help Now