hexagon logo

Script PC-DMIS interface fails to run

Hello, I just started VS2022 to write PC-DMIS scripts with VB.NET code, and now I find that there is a problem, there is a problem between the versions of 2017, 2018, 2019, 2020, 2021, and 2022,
System.Runtime.InteropServices.
COMException: "Retrieving the COM class factory for component with CLSID {F8AB340E-C31E-4AAF-8C70-B6A549B075DE} failed due to the following error: 80080005 The server failed to run (0x80080005 (CO_E_SERVER _EXEC_FAILURE))."
This question How to solve it, can I compress and pack a copy of the example and send it to me?

Attached Files
Parents
  • Other things to try: From the PC-DMIS Object Library.

    1. Run your program as administrator to make sure the problem is not caused by Win UAC.

    2. Do NOT use "new PCDLRN.Application" to create PCDLRN.Application object, since it could cause PC-DMIS version problems.
    Try to use CreateInstance(type) as shown in the example below to create the application object instead.

    C# code.
                var DmisApp = Type.GetTypeFromProgID("PCDLRN.Application");
                var pcdmis = Activator.CreateInstance(DmisApp) as PCDLRN.Application;
                var DmisPart = pcdmis.ActivePartProgram;
                var DmisCommands = DmisPart.Commands;
                var CommandCount = DmisCommands.Count;
                var DmisCommand = DmisCommands.Item(CommandCount);​
    


    VB.NET code
    Dim DmisApp = Type.GetTypeFromProgID("PCDLRN.Application")
    Dim pcdmis = TryCast(Activator.CreateInstance(DmisApp), PCDLRN.Application)
    Dim DmisPart = pcdmis.ActivePartProgram
    Dim DmisCommands = DmisPart.Commands
    Dim CommandCount = DmisCommands.Count
    Dim DmisCommand = DmisCommands.Item(CommandCount)
    ​
    
Reply
  • Other things to try: From the PC-DMIS Object Library.

    1. Run your program as administrator to make sure the problem is not caused by Win UAC.

    2. Do NOT use "new PCDLRN.Application" to create PCDLRN.Application object, since it could cause PC-DMIS version problems.
    Try to use CreateInstance(type) as shown in the example below to create the application object instead.

    C# code.
                var DmisApp = Type.GetTypeFromProgID("PCDLRN.Application");
                var pcdmis = Activator.CreateInstance(DmisApp) as PCDLRN.Application;
                var DmisPart = pcdmis.ActivePartProgram;
                var DmisCommands = DmisPart.Commands;
                var CommandCount = DmisCommands.Count;
                var DmisCommand = DmisCommands.Item(CommandCount);​
    


    VB.NET code
    Dim DmisApp = Type.GetTypeFromProgID("PCDLRN.Application")
    Dim pcdmis = TryCast(Activator.CreateInstance(DmisApp), PCDLRN.Application)
    Dim DmisPart = pcdmis.ActivePartProgram
    Dim DmisCommands = DmisPart.Commands
    Dim CommandCount = DmisCommands.Count
    Dim DmisCommand = DmisCommands.Item(CommandCount)
    ​
    
Children
No Data