Search This Blog

Thursday, March 25, 2010

How to create a DLL in VB.NET?

Creating a DLL in VB.NET
---------------------------------------------
Start a project as Classlibray and add CODE
----------------------------------------------
Imports System.Windows.Forms
Public Class Class1

    Public Sub Main(ByVal ary() As Integer, ByVal ary_2() As Integer)
        'populate the array
        Dim i As Integer
        For i = 0 To ary.Length - 1
            ary_2(i) = ary(i) + 10
        Next i
       MessageBox.Show("10 has been added in each array element of ary1.")
    End Sub
End Class
------------------------------
*** To use Messagebox in VB.NET DLL you have to:
Do this :  Project menu select "Add Reference".  and locate System.Windows.Forms, select it and press
OK button.
---------------------------------------------
Now bulid you get DLL file in the Debug or Release folder as per settings.

Also See : How to use DLL in VB.NETcreated in VB.NET

No comments:

Post a Comment