?
Solved

Creating DLL's With VB5.0

Posted on 1998-12-25
3
Medium Priority
?
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
Aum earned 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses

771 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