Avatar of tomerbar

asked on 

How do I connect between the ActiveX and the JavaScript?

Hello all,
I've been trying to create an ActiveX to run on my website.
I made the dll, packed it as a .cab file and certified it.
Made the HTML and Javascript parts and ran it on my Apache webserver and I keep getting Javascript error.
I cant seem to invoke the ActiveX functions.

I made sure the cab is certified and installed correctly and it is, I took care of the GUID, I wrote everything as I read on the net (The attache link).

Attached is the c# code (very simple).
Then there is the Javascript, that seems to break at this line: "var x = new ActiveXObject("ClassLibrary1.Class1");"
And the final thing is the HTML object embedded.

I think maybe I'm compiling the C# wrong or something... can someone see what i'm doing wrong?
using System;
using System.Runtime.InteropServices;
namespace ClassLibrary1 
  public interface ASignatures
    string FName();
    string SName();
    int Age { get;}  
  public class Class1 :ASignatures
    public string FName()
      return "Imran";
    public string SName()
      return "Nathani";
    public int Age
      get { return 24; }
<script type="javascript">
function NotifyActiveX(e)
	if ( e.readyState != 4 ) return;
	var x = new ActiveXObject("ClassLibrary1.Class1");
<b>ActiveX is not supported</b>

Open in new window

.NET ProgrammingWeb ComponentsJavaScript

Avatar of undefined
Last Comment

8/22/2022 - Mon