How to write my own activex registration element (in C #)?

I managed to create a small activex control, but this requires that the DLL be registered on the client (using regasm).

How can I avoid this registration problem?

I am trying to write an activex control that is delivered over the Internet (to IE browsers) that will access the clients webcam (using directshow).

Here is my simple control:

  using System;
  using System.Runtime.InteropServices;
  namespace HelloNS
  {
      public interface IHello
      {
        string Message();
      }

      [ClassInterface(ClassInterfaceType.AutoDual)]
      public class Hello : IHello          {
        public string Message()
        {
            return "hello";
        }
      }
   }

And here is my viewer:

<html>
<head>
  <script language="javascript">
    var x = new ActiveXObject("HelloNS.Hello");
    alert(x.Message());
  </script>
</head>
<body>
</body>
</html>

I am currently reading this on msdn: http://msdn.microsoft.com/en-us/library/aa751970(VS.85).aspx

If I find out, I will post the results.

+3
source share
2 answers

COM-, , , Windows. , .NET, COM Interop . .

, - ClickOnce, , .

+1

(DLR) , VS2010 .NET 4.0, . COM-, .. , .

.NET 4.0? -.

, - . Javascript # .

+1

Source: https://habr.com/ru/post/1709359/


All Articles