Creating PetroSIM COM-object in Mathematica fails

0

I'm trying to invoke Petro-SIM from Mathematica using the following command:

petrosim = CreateCOMObject["PetroSIM.Application"];

This returns the following error-message:

CreateCOMObject::netexcptn: A .NET exception occurred: 
System.Runtime.InteropServices.COMException (0x800401F3):
Ungültige Klassenzeichenfolge (Ausnahme von HRESULT: 0x800401F3 (CO_E_CLASSSTRING)) bei System.RuntimeType.GetTypeFromProgIDImpl(String progID, String server, Boolean throwOnError) bei Wolfram.NETLink.Internal.COM.COMUtilities.createCOMObject(String clsIDOrProgID) bei Wolfram.NETLink.Internal.CallPacketHandler.createCOM(KernelLinkImpl ml).

Sorry about the german, last line should translate to something like:

Invalid string-class (Exception of HRESULT: 0x800401F3 (CO_E_CLASSSTRING)) at System.RuntimeType.GetTypeFromProgIDImpl(String progID, String server, Boolean throwOnError) at Wolfram.NETLink.Internal.COM.COMUtilities.createCOMObject(String clsIDOrProgID) at Wolfram.NETLink.Internal.CallPacketHandler.createCOM(KernelLinkImpl ml).

I'm using the same Mathematica version and Petro-Sim version on a different computer and it's working fine. I've no knowledge about .NET and these kind of things and all the problems I've found on the internet so far didn't help. Do you have any idea where this issue comes from? thanks in advance!

.net
com
wolfram-mathematica
asked on Stack Overflow Jan 7, 2019 by brettljausn

1 Answer

1

First you need to verify that HKCR\PetroSIM.Application is in the registry. Then verify that the CLSID is in the registry, then verify that the application is installed.

You could verify running this Powershell macro which will give the pertinent information:

param
(
 [Parameter(Mandatory=$true)] [string]  $ProgId
)

$ProgIdPath = join-path "hklm:\software\classes" $ProgId

$ProgIdPath = join-path $ProgIdPath "CLSID"

Try
{
    $ProgIdEntry = gi $ProgIdPath

    $CLSID = $ProgIdEntry.GetValue("")

    Write-Host "CLSID: " $CLSID

    $CLSIDPath = join-path "hklm:\software\classes\clsid" $CLSID

    $CLSIDEntry = gi -path $CLSIDPath

    ls $CLSIDEntry.PSPath
}
Catch
{
}
answered on Stack Overflow Jan 8, 2019 by Joseph Willcoxson

User contributions licensed under CC BY-SA 3.0