VB.Net 2005 DLL Tutorial

In this tutorial we will walk you through a process to build a COM DLL. A COM DLL can easily be imported into any VB.Net program with little to no effort.

Firstly, we will begin with a New Project > Class Library.

Now that you have created a new class library it is time to delete the Class1.vb file and import a COM Class file into the project.

With the COM Class file imported into the project, now is the time to add all your functions or sub-routines to the COM Class library.

With the functions added, now is the time to save and build the DLL. After saving the DLL and building it, it is time to create a new project and add the new DLL as a reference. Browse your My Projects folder in My Documents for the DLL folder and search for the Release version of the new DLL to import using Project > Add References

Now that you have added your reference, it is time to reference it in some code. Add a button to the new project form and in the button handler add the following code.

With a reference to the DLL in the MsgBox(Junkie.dark) portion of the code, you can now compile the program and press the button to see the functions in action!

This is the end of the tutorial. We hope you can now create COM DLL's with all your functions in for referencing in your code segments and new projects!

Tutorial by Xander Obrzut © May 2009