Interop COM not working with MultiTerm 2021 and 2022 - HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

When trying to use the Interop COM interface and create an Application instance, I always get the following error message (as if there is no MultiTerm installed on the system):

The COM class factory for the component with CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} could not be retrieved due to the following error: 80040154 Class not registered (exception of HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at RWS_MultiTerm_Interop_Test.frmMain.InitMultiTerm() in <PATH TO SOURCE FILE>:line 228.

A MultiTerm repair installation, as well as a complete reinstallation, has already been attempted. Likewise, testing has been done on multiple systems and with multiple MultiTerm versions, which are:

  • MultiTerm 2021 SR2 - 16.2.1.1044
  • MultiTerm 2022 SR1 - 17.1.1.2185

  • Microsoft Windows 7 Enterprise version 6.1.7601 Service Pack 1 Build 7601
  • Microsoft Windows 10 Pro Version 10.0.19045 Build 19045
  • Microsoft Windows 11 Pro Version 10.0.22621 Build 22621

We have also been in contact with a developer from RWS who sadly is currently not able to respond to us and our business contact at RWS urged us to create another post here to further this issue and hopefully a resolution forward.

With the mentioned RWS developer we were in contact with, he reviewed a sample application we provided and asked us to try out the following sample by RWS (which ultimately led to the same error message above): https://github.com/RWS/Sdl-Community/tree/bb990fb00165398395d10bfbb4d233ef4f4a4e5d/Code%20samples/MultiTermSearchExample

Error message on Trados Studio indicating COM class factory component with CLSID could not be retrieved, suggesting MultiTerm is not installed.

Code snippet from Trados Studio showing the instantiation of a new MultiTerm application and connection to the local repository.



Generated Image Alt-Text
[edited by: Trados AI at 10:12 AM (GMT 0) on 6 Mar 2024]
Parents
  • Hi Raimo, this looks like a conflict between the intreop file and the installed MultiTerm COM classes. Which interop file are you referencing in your project? Also keep in mind that MultiTerm and Studio use the same shared terminology components. A common cause for trouble. Let's assume you have installed MultiTerm 2021 SR1, and linked C:\Program Files (x86)\Common Files\Trados\MultiTerm16\Sdl.MultiTerm.TMO.Interop.dll. If you now install Studio 2021 SR2, you'll likely get the class not registered error. This can get ugly, especially if you installed many different versions on a machine, or for extra fun had a crash during un/installation.

    So the first steps I'd look at:

    • check there is only one version of MultiTerm and Studio installed
    • check that they are both on the same version. The release note usually contain information on compatible releases
    • check that the interop dll is from the same version

    Cheers, Gerhard

  • Hello Gerhard,

    sorry for the late response but I was working on a bunch of high priority projects and did not get time allotted to test your solution until now. Sadly I had no success. We even set up a completely new test environment but had no success getting the sample project running there either with the same error at the exact same line in our code.

    Do you have any other theories on what could be the issue we're facing? Were you able to reproduce our issue?

    Thank you in advance for any further assistance you can provide.

    Kind regards

    Raimo Geisel

  • I can easily reproduce this error by using a Sdl.MultiTerm.TMO.Interop.dll that is from a different version. The interop is basically a map between class names and UIDs. When the code asks to create a Tmo.Interop.Application object, the frameworks loads the UID for "Application" from the interop and then goes looking for it in the registry CLSID list. If it finds it, that is enough to create a COM object. If it doesn't find it, you get the "Class not registered" error.

    To allow side by side installations of different versions, the UIDs change for each major Trados version

    On your screen shot, the missing UID is {DE9895DD-A527...} which is the code from Trados 2019. So it looks like your project is referencing an old interop file from Trados 2019. That also explains why reinstallations of 2021 and 2022 did not work. So I can just advise that you check again which interop the project uses, and point it to a new one from your current installation of Trados. Library versioning and side by side installations are a pain the neck. 

    Good luck, Gerhard

Reply
  • I can easily reproduce this error by using a Sdl.MultiTerm.TMO.Interop.dll that is from a different version. The interop is basically a map between class names and UIDs. When the code asks to create a Tmo.Interop.Application object, the frameworks loads the UID for "Application" from the interop and then goes looking for it in the registry CLSID list. If it finds it, that is enough to create a COM object. If it doesn't find it, you get the "Class not registered" error.

    To allow side by side installations of different versions, the UIDs change for each major Trados version

    On your screen shot, the missing UID is {DE9895DD-A527...} which is the code from Trados 2019. So it looks like your project is referencing an old interop file from Trados 2019. That also explains why reinstallations of 2021 and 2022 did not work. So I can just advise that you check again which interop the project uses, and point it to a new one from your current installation of Trados. Library versioning and side by side installations are a pain the neck. 

    Good luck, Gerhard

Children