Book a Demo

Author Topic: Variant in API  (Read 3401 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Variant in API
« on: July 21, 2020, 06:42:26 pm »
Hey everybody,


The Add-In Model API is documented with Visual Basic syntax and has Variant parameters all the way through.
The Object Model documentation uses C-style syntax, and there are variants here and there in that as well.

The problem is that Variant is no longer a supported type in .NET. It hasn't been for years.
So if you create an Add-In in Visual Basic and painstakingly copy in all the operations from the documentation, your code won't compile. You get any number of BC30804s.

There's a simple fix -- replace Variant with Object -- but the documentation should be right. It's still wrong in 15.2, and this isn't a new thing from Microsoft.
The problem isn't as big in the Object Model since you-the-programmer don't actually write those declarations, but it's still wrong.

So in VB-style documentation Variant should be replaced with Object, and in C-style documentation variant with dynamic.


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Variant in API
« Reply #1 on: July 21, 2020, 06:46:24 pm »
Reported.
My theories are always correct, just apply them to the right reality.