1

Used by:
Win 7x64;
Visual Studio 2019;
MindManager 2019 - MM 19.1.198 (32-x.) 10.01.2019;

Problem:
 My code is throwing the COM class not registered error on the line:
mm.Topic topic = new mm.Topic ();. I get an error.   Error:

Failed to get COM class factory  for component with CLSID {169B91A2-8B3F-4C13-8FD6-81D4C2F76F3D}  due to the following error: 80040154 The class is not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

The code:

using mm = Mindjet.MindManager.Interop;

mm.Application app;
mm.Document docActiv;
public Form1()
{
    InitializeComponent();

    app = new mm.Application();
}

public void SetXMLProperty(string xmlContent)
{
    docActiv = app.ActiveDocument;

    mm.Topic topic = new mm.Topic();

    topic.Xml = xmlContent;

    docActiv.FloatingTopics.Insert(topic);
}

Question.
What library do I need to register for the Topic class?


Update-1

 Based on the comment pstrjds - quote:

 > I found this potential workaround` Using a 32bit COM object in a 64bit environment https://techtalk.gfi.com/32bit-object-64bit-environment/

 I perform the actions according to the instructions:
 1. I defined the GUID of the COM object.
See Picture-1.
 2. I am searching for an object:
 HKey_Classes_Root\Wow6432Node\CLSID\[GUID]
 3. The result.
 I have no object {1E1D4AF9-6640-49C1-A33B-8CE8B47C9785} in the folder HKey_Classes_Root\Wow6432Node\CLSID\[GUID] no.  
 The object {1E1D4AF9-6640-49C1-A33B-8CE8B47C9785} is located in the folders below. (if required, I can attach pictures of the contents of these folders)

 
HKEY_CLASSES_ROOT
HKEY_CLASSES_ROOT\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}
HKEY_CLASSES_ROOT\Wow6432Node\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}

HKEY_LOCAL_MACHINE
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\Wow6432Node\TypeLib{1E1D4AF9-6640-49C1-A33B-8CE8B47C9785}
 
 Question.Update-1
 1. In which folder do I need to follow the instructions?

Picture-1
Picture-1


Update 2.

I am trying to change the solution platform.

Picture-1 enter image description here

Picture-2 enter image description here

For x86
 After - 2 sec. mistake.
 Line 36. mm.Topic topic = new mm.Topic ();
 Failed to get COM class factory for component with CLSID {169B91A2-8B3F-4C13-8FD6-81D4C2F76F3D}
 due to the following error: 80040154 The class is not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

   
 For x64
 After - 25 sec. mistake.
 Line 32. app = new mm.Application ();
 Failed to get COM class factory for component with CLSID {CE786F70-B064-4766-B24D-E6D942936D50} ​​due to the following error: 80080005 Error while executing server application (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
 
 The note.
 For X86 requires a component with CLSID {169B91A2-8B3F-4C13-8FD6-81D4C2F76F3D};
 For x64 equires a component with CLSID {CE786F70-B064-4766-B24D-E6D942936D50}.

eusataf
  • 807
  • 1
  • 12
  • 24
  • 1
    Is the MindManager dll registered on your system? This error is coming from the interop class. It is looking for the COM registered dll. The dll needs to be registered with `regsvr32.exe` – pstrjds Oct 05 '19 at 14:59
  • @pstrjds **1.** `Is the MindManager dll registered on your system?` I do not know. I have not encountered such problems before. For example, this code works `` **2.** Do I need to register a dll with `regsvr32.exe`? – eusataf Oct 05 '19 at 15:11
  • @pstrjds Code `public string[] GetText() { string[] result = null; docActiv = app.ActiveDocument; // mm.Topic = docActiv.top var select = docActiv.Selection; List list = new List(); foreach (mm.Topic topic in select) { list.Add(topic.Text); result = new string[] { topic.Title.TextRTF }; result = new string[] { topic.Xml}; } return result; }` – eusataf Oct 05 '19 at 15:12
  • 1
    If you google `Failed to get COM class factory for component with CLSID` you are going to find thousands of results telling you that you need to register the library. Is MindManager installed on the system where you are running this code? I would assume the installation would register the COM object, but maybe not. Look in your developer/API documentation for steps required. If you need to manually register it, it should tell you. Also, just as a possible option, double check if you are running a 64 bit vs 32 bit app, maybe your MM install is 32 bit. – pstrjds Oct 05 '19 at 16:34
  • 1
    I edited your question to clarify what the actual problem is. You are having a COM registration issue. From your comments I am guessing you have not had to deal with COM before - if you are going to be dealing with COM interop I would recommend doing some reading about COM programming and how it works. Here is a link to an MS tutorial: https://msdn.microsoft.com/en-us/ie/aa645736%28v=vs.94%29?f=255&MSPPError=-2147217396 – pstrjds Oct 05 '19 at 16:42
  • @pstrjds Thank. I will try to understand. I have installed MM - 32-bit. (MM 19.1.198 (32-bit) 01/10/2019) – eusataf Oct 05 '19 at 16:45
  • 1
    I just re-read your last message and I would suggest you double check whether your compiler settings are targeting a 32 bit build or a 64 bit build, since your COM object is probably only registered as a 32 bit object. If your build is 64 bit(x64) then you can get class registration errors. I found this potential workaround [Using a 32bit COM object in a 64bit environment](https://techtalk.gfi.com/32bit-object-64bit-environment/), but have never tried it myself. First I would verify what platform your app is targeting, and if it isn't x86, change it to that and try it. – pstrjds Oct 07 '19 at 16:28
  • @pstrjds The instructions say what to look for in the folder `HKey_Classes_Root \ Wow6432Node \ CLSID \ [GUID]`. I do not have an object in this folder. What to do? See `Update-1`. – eusataf Oct 08 '19 at 09:43
  • 1
    I am assuming from your comment that you verified that your app is 64 bit. Did it work when you changed it to target 32 bit? As far as the CLSID you need to find, it's the one that your exception told you is not registered. You need to look for and follow the steps for the CLSID `169B91A2-8B3F-4C13-8FD6-81D4C2F76F3D` – pstrjds Oct 08 '19 at 12:30
  • 1
    If the application works when compiled targeting x86, then you will find CLSID `169B91A2-8B3F-4C13-8FD6-81D4C2F76F3D` in that registry folder. If it doesn't work when targeting x86, then you probably won't find it in that folder. That means the COM object is not registered and so you will need to register it, following the instructions from MindManager's documentation. Most likely it is just a matter of calling regsvr32.exe with the appropriate dll from MindManager. That should register it and you should be good to go from there. – pstrjds Oct 08 '19 at 12:45
  • @pstrjds `From your comment, I assume that you are convinced that your application is 64-bit.  Did it work when you changed it to 32-bit? ` I tried to check your solution. But it did not help. Did I understand you correctly? See ** Update-2 **. – eusataf Oct 08 '19 at 13:15
  • 1
    Okay - so the issue is you need to register the COM object and apparently it uses a different object depending on whether it is 32 or 64 bit. So the solution is to register the COM objects. If there is some sort of registration needed, the API documentation should tell you that and tell you how to do it. You need to know which library you need to register. If they have a developer forum you can try asking there, but first search for "Class not registered" in the forum as you may find it is already answered. – pstrjds Oct 08 '19 at 13:21
  • 1
    Possible duplicate of [How to solve COM Exception Class not registered (Exception from HRESULT: 0x80040154 (REGDB\_E\_CLASSNOTREG))?](https://stackoverflow.com/questions/1496214/how-to-solve-com-exception-class-not-registered-exception-from-hresult-0x80040) – pstrjds Oct 13 '19 at 12:12

0 Answers0