CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1998
    Posts
    1

    How to make a DLL ?



    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.

  2. #2
    Join Date
    Dec 1998
    Posts
    5

    Re: How to make a DLL ?



    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured