- 1). Locate the DLL file on your computer and add a reference to that file from your VB.NET application. Select "Project" from the menu and then "Add References." The file may exist under the "COM" tab or you may locate the DLL under the "Browse" tab.
- 2). Select the DLL file and click the "OK" button. This adds a reference to the DLL within your VB.NET project. Create a variable in your application to hold a reference to the DLL object in the VB.NET code.
- 3). Set the new variable equal to a new instance of the DLL object. Another way to accomplish this is to set the new variable equal to "CreateObject(MyDLLObject)" where "MyDLLObject" is the name of the public class defined in the DLL.
- 4). Reference any of the public functions defined within the DLL project in your VB.NET application by citing the new variable name, followed by a period and the function name.
- 5). Set the object reference to "Nothing" before exiting the program in the .NET code. It is important to destroy any object reference used in an application to release it from memory.
previous post