How to create a simple dll in VB. and how to use it with other applications
Creation of DLL
Collapse
X
-
To create the dll:
1. Start a new project in VB, and select ActiveX DLL for project type.
2. Add a class.
3. Set the classes instancing to 5 - Multiuse or 6 - Globalmultiuse.
4. Give the class a public method.
5. Compile the project.
To instantiate the dll -
with CreateObject:
with project references:Code:Dim MyObject As Object Set MyObject = CreateObject ("MyDllProject.MyDllClass")
Register the Dll (though, you dont need to if you compiled it on the same machine):
1. Add a reference the dll (project/references).
(note: if you do not see your class in the list, click Browse to select the dll).
Then, you can work with the methods defined publicly for the class:Code:Dim MyObject As MyDllProject.MyDllClass
Hope it helpsCode:MyObject.MyMethod()
Comment