Click here to Skip to main content
15,896,422 members
Articles / Programming Languages / VBScript

ActiveX EXE Wrappers

Rate me:
Please Sign up or sign in to vote.
3.65/5 (13 votes)
22 Nov 2006CPOL9 min read 110.9K   1.3K   58  
How to expose a .NET EXE assembly to a COM compliant client application (such as VB6 or VBScript) and force the client application to use the running instance of the .NET EXE assembly.
Public Class frmMain

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.ListBox1.Items.Insert(0, DateTime.Now.ToLongTimeString() & " - Hello World!  this was added internally")

        ' Alternativly, we could use the ComExpose object for adding items directly to the list box
        'Dim MyComExpose As ComExpose

        'MyComExpose = New ComExpose()
        'MyComExpose.DisplayMessage("Hello World!  This was added internally through the ComExpose object")

    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' save a reference of this object in the App shared variable
        '   (if it's not already there!)
        If App.MainForm Is Nothing Then App.MainForm = Me

    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Developer

Comments and Discussions