ProgID通过VBScript创建对象时出错

时间:2016-04-29 14:36:39

标签: vbscript com

使用RegAsm.exe \ TSTestHarnessWCFClient.dll / codebase

访问在注册表中注册的COM对象时出现问题

这是VBScript代码:

Set oTestHarness = CreateObject("ProgramIDOfCOM")
If  oTestHarness.Init("EnvName", "UserName") = false then
    MsgBox("Test Harness cannot be initialized")

End If

错误代码:80131534

构造函数内的代码

public TestHarnessCOM_Class()
        {

            ChannelFactory<ITestHarnessExecutor> pipeFactory =
                   new ChannelFactory<ITestHarnessExecutor>(
                     new NetNamedPipeBinding(),
                     new EndpointAddress(
                       "net.pipe://localhost/PipeTestHarness"));

            pipeTestHarness = pipeFactory.CreateChannel();
            ((IContextChannel)pipeTestHarness).OperationTimeout = new TimeSpan(2
                , 0, 0);

        }

0 个答案:

没有答案