Provide add-in function in my own app?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Provide add-in function in my own app?

  1. #1
    Luise Zhou Guest

    Provide add-in function in my own app?


    Hi,

    Can any one tell me how to provide add-in functions in my own application
    which like VB-IDE does?
    Any suggestion will be appreciated.

    Best regards
    Luise Zhou

  2. #2
    David Ng Guest

    Re: Provide add-in function in my own app?

    Hey,

    I was stumped at this question too...but i figured it out on the weekend!!!

    1: Create a new ActiveX EXE project, this is your main app.
    call the project TestApp
    call the form frmTestApp
    2: Create a new ActiveX DLL project, this is your plugin.
    3: Set the project name to TestPlugin.
    4: Set the class name to CTestPlugin.
    5: Set the Instacing of the CTestPlugin class to MultiUse.
    6: Put the follwoing code in the declarations section of the CTestPlugin
    class:
    ----cut----------------------------------------------------
    Public Property Get GetPluginDescription() As String
    GetPluginDescription = "A dummy test plugin."
    End Property
    ----cut----------------------------------------------------
    7: Put the following code into the Form_Click event of the main form in your
    TestApp project.
    ----cut----------------------------------------------------
    Dim objTest As Object
    Dim sTitle As String

    sTitle = "CTestPlugin" 'name of plugin class
    Set objTest = CreateObject("TestPlugin." & sTitle) 'Note
    TestPlugin, the name

    'of the project
    msgbox objTest.GetPluginDescription 'Name of
    function
    Set objTest = Nothing 'destroy the object once we're finished
    ----cut----------------------------------------------------
    8: Compile the TestApp prrogram
    9: In the TestPlugin project, add a reference to the newly compiled TestApp
    (use the browse button to find it)
    10: Compile the DLL, then register it using regsvr32.exe
    eg. c:\windows\system> regsvr32 c:\testplugin\testplugin.dll
    11: Run the TestApp, click the form, and bam! the a message box pops up with
    the plugin description.


    Check out the VB Books Online program about classes and how to expose them
    from your TestApp...

    hope this helps...and i hope its not buggy cos i typed it up pretty quick...

    David Ng
    dasng@eisa.net.au

    Luise Zhou <xmihu@hotmail.com> wrote in message
    news:39278f16$1@news.devx.com...
    >
    > Hi,
    >
    > Can any one tell me how to provide add-in functions in my own application
    > which like VB-IDE does?
    > Any suggestion will be appreciated.
    >
    > Best regards
    > Luise Zhou




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center