Results 1 to 3 of 3

Thread: Create ActiveX dll with Visual Basic

  1. #1
    Join Date
    Apr 2009
    Posts
    102

    Create ActiveX dll with Visual Basic

    Hello,

    I am developing an Third party application where i need to create an ActiveX dll file using Visual basic, but i don't know how to start with the same and i find that this is possible but not difficult so please help me how to do it.

    thanks for your help.

  2. #2
    Join Date
    Oct 2008
    Posts
    167

    Re: Create ActiveX dll with Visual Basic

    we need to assign the class in the Dll to an object variable. So add this code to the general declarations section of your forms code module:

    Dim X As CSomeDll
    'CSomeDll' is the name of the class in the DLL that has the method we want to use. We named it this in step 2 of creating the Dll.

    Now add this code to Command1:

    Code:
    Private Sub Command1_Click()
    
    Set X = New CSomeDll '<---Assigns an object reference
    Text1.Text = X.ReverseString(Text1)
    Set X = Nothing '<--------Release resources to the object
    
    End Sub

  3. #3
    Join Date
    Dec 2008
    Posts
    202

    Re: Create ActiveX dll with Visual Basic

    Here I will provide you the details about how to create the ActiveX dll file.

    creating the dll file.

    1. Start VB window it should be Visual studio 2005 and select ActiveX Dll for the project type.
    2. In the properties window for the Class (the only code window in the project), Provide any suitable name to your project such as 'createDll'. but the project name should be similar to form name.
    3. Browse Project from the menu, select Project1 Properties from the drop down list, change the project name to 'createDll', and provide the suitable Project Description to 'This is a useless DLL'. This description will Important from all aspects.
    4. You need to add a method (Function) to the class. You may take a any string as its parameter and may returns it spelled backwards. there will be no issues as this function will be already exists in VB, this will be just as for your example.


      Code:
      Option Explicit
      
      Public Function ReverseString(ByRef SomeString As String) As String
      
      ReverseString = StrReverse(SomeString)
      
      End Function
    5. You are not ready to compile it by selecting File, in the drop-down list you will be allow to select Make SomeDll.dll and choose a safe place to save it.
    6. Save the project wherever you like and close it.

    and here your Dll is ready for a client application to use it.

Similar Threads

  1. How to create installation package of application in visual basic 6.0
    By Badrinath18 in forum Software Development
    Replies: 5
    Last Post: 02-07-2011, 07:28 PM
  2. How to create a Smart Tag DLL in Visual Basic?
    By warehouse peon in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 05:04 AM
  3. How to create Windows DLL with Visual Basic?
    By Flaco in forum Software Development
    Replies: 4
    Last Post: 27-02-2010, 04:39 AM
  4. How to Create ActiveX Controls in Visual Basic 6
    By geokilla in forum Software Development
    Replies: 3
    Last Post: 30-09-2009, 03:36 PM
  5. How to create an .exe file in visual basic
    By kasha_i in forum Software Development
    Replies: 3
    Last Post: 21-04-2009, 11:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,880,899.38725 seconds with 17 queries