Book a Demo

Author Topic: Interfaces (IDual vs I)  (Read 8736 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Interfaces (IDual vs I)
« on: January 11, 2011, 04:05:52 am »
Hi All

Probably a question directed at the Sparxians, but in the object model API the Interfaces appear to be duplicated, IDualElement, IElement, IDualCollection, ICollection etc

Is there any fundamental difference between the IDual version and the I version?

If not why are both supplied? If there is what is the difference and when should each be used?

If have written Add-ins using IDual and I have written Add-ins using I, and I cannot see any noticable difference

Any thoughts?
Models are great!
Correct models are even greater!

alesliehughes

  • EA Administrator
  • EA User
  • *****
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Interfaces (IDual vs I)
« Reply #1 on: January 11, 2011, 08:30:55 am »
There is no functional difference between the two interfaces, they are kept for to maintain backwards compatibility.

If you using a language like C++ you tend to use the I interface, where VB,C# use the dual interface, not to say you cant use the other one.

The main difference is the way the function/methods are defined, for example (C++)
boolean IProject.LoadProject(VARIANT FileName) -> I interface
HRESULT IDualProjectLoadProject([in] BSTR FileName, [out,retval] VARIANT_BOOL* pRet) -> IDual interface.
The IDual interface takes a string directly, whereas the I interface you have to manually convert to the VARIANT type first.  All this is transparent to you if you C# or VB.

Hope this help
Alistair

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Interfaces (IDual vs I)
« Reply #2 on: January 11, 2011, 08:56:30 pm »
Thanks Alistair, that clarifies it for me I use C# and so will continue to use the IDual

Thanks again

Phil
Models are great!
Correct models are even greater!