Creation of DLL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • viveka
    New Member
    • Aug 2007
    • 1

    #1

    Creation of DLL

    How to create a simple dll in VB. and how to use it with other applications
  • VBPhilly
    New Member
    • Aug 2007
    • 95

    #2
    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:

    Code:
    Dim MyObject As Object
    
    Set MyObject = CreateObject ("MyDllProject.MyDllClass")
    with project references:

    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).

    Code:
    Dim MyObject As MyDllProject.MyDllClass
    Then, you can work with the methods defined publicly for the class:

    Code:
    MyObject.MyMethod()
    Hope it helps

    Comment

    Working...