Solved

Creating DLL's With VB5.0

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 85
Put text in a picture ASP.NET C# 2 68
Add and format columns in vb6 7 73
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 38
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

730 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