This is a very unfortunate sample of code; the chances of success are very close to zero. This is a product of the MSDN Forum Support Group, and their work is not tested by experts at Microsoft. One team member later confirmed that this is not the right way to do this.
The problem with this code is that it completely ignores the note in the MSDN documentation for the RegistrationServices.RegisterTypeForComClients () method:
, CoRegisterClassObject CoDisconnectObject COM .
, , . , COM- . , , , , RPC. , , .
.NET , . , . COM , . , , COM IDL midl.exe. C, , DLL. DLL HKCR\Interface, COM DLL , . , IDispatch , OLE Automation. . , HKCR\Interface, COM .
, . midl.exe, DLL /, . , , E_NOINTERFACE , . , crappy .
.NET COM- - COM+. System.EnterpriseServices.ServicedComponent . MSDN .