Accessing C# classes from IE (JScript)
I'm looking for a way to access some C# from JScript. I tried to wrap the class with COM proxy by using some COM attributes (ClassInterface, InterfaceType ...).
When I try to instantiate the object from within a C++ program, I succeed.
when I try to declare the class as an object in HTML page and access it from
JScript, I do not succeed.
When I try to use the ActiveX Control Test Container, it would not succeed creating the object.
attached : a code sample of the C# class as it appears in MSDN tutorials. using
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace CSharpServer
{
// Since the .NET Framework interface and coclass have to behave as
// COM objects, we have to give them guids.
[Guid("DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D05")]
publicinterface IManagedInterface
{
int PrintHi(string name);
}
[Guid("C6659361-1625-4746-931C-36014B146679"),
ProgId("CSharpServer::InterfaceImplementation")]
publicclass InterfaceImplementation : IManagedInterface
{
publicint PrintHi(string name)
{
Console.WriteLine("Hello, {0}!", name);
return 1;
}
}
}

