Topic
  • 1 reply
  • Latest Post - ‏2013-06-13T12:13:26Z by MrTrigger
MrTrigger
MrTrigger
2 Posts

Pinned topic Adding tag with API => OLE_E_CANT_GETMONIKER exception

‏2013-06-13T12:01:47Z |

Hi,
when trying to add a tag to a class i get the exception "Not able to get the moniker of the object (Exception from HRESULT: 0x80040009 (OLE_E_CANT_GETMONIKER))", what's happening?

Code:

            appl.createNewProject(@"C:\tmp", "TestProject");
            RPProject project = appl.activeProject();
            var pkg = project.addPackage("TestPkg");
            var myClass = pkg.addClass("TestClass");
            IRPTag myTag = (IRPTag)myClass.addNewAggr("Version", "2");  <-- Throws exception
 

Written in C#, using Rhapsody 8.0.2 on Windows 7 x64.

 

  • MrTrigger
    MrTrigger
    2 Posts

    Re: Adding tag with API => OLE_E_CANT_GETMONIKER exception

    ‏2013-06-13T12:13:26Z  

    Nevermind, figured it out my self.
    It should be:

                IRPTag myTag1 = (IRPTag)myClass.addNewAggr("Tag", "Version");
                myTag1.value = "2";

    Cheers