Author Topic: TaggedValues for connectors - bug in API  (Read 4549 times)

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
TaggedValues for connectors - bug in API
« on: November 10, 2014, 08:57:48 pm »
I've come to this problem which I think is a bug in the EA API.

EA has the ability to add a taggedValue to a connector. This is done in the properties of the connector (Same for elements and so).

However if I add a taggedvalue to a connector and then loops through the taggedValues for the connector in the API it throws an exception (see below).

foreach (TaggedValue tv in connector.TaggedValues)
{
      //Do something
}

But if there is no taggedvalue in the connector it doesn't throw an exception. So I can't access the taggedValues of the connector from the API which might be a bug.

Using EA v.10 and visual studio 10.

EXCEPTION:
Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #1 on: November 10, 2014, 09:42:47 pm »
I just ran a little test and had no issue accessing a TV for a connector.

q.

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #2 on: November 10, 2014, 09:47:58 pm »
Did you have a taggedValue added to the connector cause that's the only case I get the error?
If I haven't added a taggedValue to the connector it doesn't throw the error while I loop through them.

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #3 on: November 10, 2014, 11:56:32 pm »
Could this be because of some dll it hasn't registered correctly? I can loop through the taggedvalues of packages and elements but not from the connectors...
This is weird.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #4 on: November 11, 2014, 12:56:16 am »
I'd try the usual suspects: User another machine/user. Re-install.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #5 on: November 11, 2014, 08:35:07 am »
Quote
EXCEPTION:
Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
That's because the class you need to use is EA.ConnectorTag, not EA.TaggedValue.

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: TaggedValues for connectors - bug in API
« Reply #6 on: November 11, 2014, 06:03:04 pm »
Quote
Quote
EXCEPTION:
Unable to cast COM object of type 'System.__ComObject' to interface type 'EA.TaggedValue'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EF08950B-949E-435F-84A3-A59E3106C3BF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
That's because the class you need to use is EA.ConnectorTag, not EA.TaggedValue.
Ty Simon. That was the problem. Didn't realize that the API had different ways to access the taggedValues. But as I can see the same thing applies for methods, attributes and so.