sample dll in


I am looking for the steps required to create a simple dll in



  • : Hi,
    : I am looking for the steps required to create a simple dll in
    : Thanks,
    : vadoola

    Do you mean a) how to call it from or b)how to actually create a dll?

    a) right click on the References part of the Solution Explorer, then add reference, now use the browse button to locate the dll you wish to use. Now you'll notice the new dll added to the reference list. Ok now go into your coding view and right at the top before Public Class add:

    Imports (without the <>) you'll notice a drop down box to help.

    Now you'll need to create an object to handle it.

    Dim oTest as new type()

    Then you would use it like a normal control

    oTest.something etc etc.

    b) Start a new project (Class Library Project)

    Now create what ever functions you want like normal, but make sure that anything that needs to interact with the outside world, will need to be made Public, and not Private. If you wanted to create something that retrieved a value from the program and then added 5 to it, and then returned the value you would do something like this:

    Public Class Class1
    Public Function RtnValue(ByVal iValue As Integer) As Integer
    RtnValue = iValue + 5
    End Function
    End Class

    and that would basically be it.

    Example for both a and b.

    Create the above dll, and name it dllTest.dll
    add it to the main projects references.
    Then at the top of the form, add:

    Imports dllTest

    then after the Public Class :

    Dim odlltest as new Class1()

    Then create a button, and add this:


    Than will send the value 5 to the dll, and run the function to add 5 to it, and then return the new value.

    I hope that helps, and you can understand my rantings ;-)

    If not, or you need further help, email me at
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion