From: Patriot on 6 May 2010 19:00 Sorry for the cross-post as my post in dotnet.framework and Interop have no takers. Could anyone help me how to create a COM ActiveX which after this object is loaded on a browser, other window programs can access its public methods? I have created a simple activeX in VB.net with a winform that has 4 textboxes, exposed its method as COM. After the loading this object on the browser, I have another window app to call its method: Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click Dim xControl As Object xControl = Microsoft.VisualBasic.CreateObject("ActiveXDotNetVB.MyControl") xControl.SetMailForm("myem...(a)comp.com", "hisem...(a)domain.com", "Test Me...", "Blah is testing...") End Sub What it is supposed to do is to populate the 4 text boxes on the browser. Though I got no exception from the codes above, but nothing is populated the 4 text boxes on the browser. It seems that the xControl is a separate entity and knows nothing about the activeX loaded on the browser. How can I make this works? Thanks ------------ Here is my class: Public Interface AxMyControl Sub SetMailForm(ByVal EmailAddress As String, _ ByVal Recipient As String, _ ByVal Subject As String, _ ByVal Body As String) End Interface Public Class MyControl Implements AxMyControl Public Sub SetMailForm(ByVal EmailAddress As String, _ ByVal Recipient As String, _ ByVal Subject As String, _ ByVal Body As String) Implements AxMyControl.SetMailForm txtSender.Text = EmailAddress txtTo.Text = Recipient txtSubject.Text = Subject txtBody.Text = Body End Sub End Class
|
Pages: 1 Prev: How to get ID of fileupload control Next: Disable textbox auto expand |