I have a COM server, implemented in C#. It exposes a class decorated like this:
[ComVisible(true)]
[ProgId("MyServer.MyClass")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
I registered the DLL with "regasm /codebase MyServer". This server must be used from a WSC (a COM server implemented in JScript). Therefore I used the AutoDispatch interface.
When the WSC calls o = new ActiveXObject("MyServer.MyClass"); I get the error "Automation serve can't create object".
I checked the registration of the COM server with this C++ program:
hr = ::CoInitialize(NULL);
hr = ::CLSIDFromProgID(L"MyServer.MyClass", &clsid);
hr = ::CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&pObj);
and was able to create the object. All return values have been checked to be S_OK.
What is needed to make the COM server accessible for JScript?