Click to See Complete Forum and Search --> : How to make a DLL ?


Alfredo Salvador
December 5th, 1998, 11:30 AM
Thanks by you Help


I'm trying to make a DLL on VB50 which will receive an string when I call, but I have problems in order to do that, maybe you have an Example about how yopu create it and how you call it on a VB Application.

CrazyD
December 12th, 1998, 10:29 AM
Hi

Create a new project, an activeX dll project.

In the class module, add this:

Public Sub MyTest( sText As String)

MsgBox sText

End Sub


Give the class a nice name, and compile the dll.

Start a new exe project. In the menu Project - References, see if you can find the new created dll. If not, use the browse button to locate it. Make sure the checkbox is checked, and press ok.

Now, add a button to the form, and in the click event of the button, add this:

Dim Dummy As New

Dummy.MyTest( "Hello me" )


Run the app and press the button. Now a messagebox pops up with the text "Hello me".

This is just a very simple way to create a dll. But it works.

Note that if you have to debug your dll, this might be a handy approach (at least I always use it).

Start an instance of VB, and load the dll. Now run the project.

Start a new instance of VB, and load the exe which uses the dll. In the menu Project - References, select the "dll project". You can see this by selecting the line which contains your dll name. Now, you should see below that the path of the dll. If you've selected the correct one, you will see that instead of a dll a vb project file is selected. That's ok.

Now, if you run the app, and there's some problem in the dll, you can go into break mode in the dll-project, change some code, and continue running it.


Hope this helps


Crazy D