Compiler error : Not seeing indexor by Index override

Having upgraded to the latest Elements (8.0.81.1681) I continue to see a problem accessing a DevExpress control. The problem does seem to Oxygene related and not DevExpress, as the problem does not present in C#.

The problem is shown in here :-

The worksheets collection should be able to be referenced by Name or by Index. In C# that works, but in Oxygene, I can only reference by name. This screenshot shows the intellisense when coding i.e. no override by Index :-

The DevExpress thread on the topic can be seen here

This isn’t critical, but is annoying…

Thanks, logged as bugs://71102

Any chance you can send me the dll that has this worksheet class (and maybe it’s dependencies)?

Actually a testcase would be even better, I just tried this:

class method Program.Main(args: array of String): Int32;
begin
  var m: DevExpress.Spreadsheet.Workbook;
  m.Worksheets[0].ToString;
  m.Worksheets['test'].ToString;
end;

with “docs”, “office” and “spreadsheet” referenced

There is something else going on here Carlo and I suspect it’s more than likely specific to my development environment.

I can’t produce a simple test case - it works. A simple winforms application in Oxygene has no problem with the overloaded accessors. I then moved on to a slightly more complex situation, bringing it closer to my live situation - which is a Hydra plugin module, but even that has worked.

Not sure where I can go next. If you take a look at the screenshot, you’ll see my slightly more complex example having built without a problem and also intellisense making the two overloads available.

Are all 3 dlls properly referenced? (docs, office and spreadsheet)

I believe you’ve identified the problem Carlo. I only referenced the Spredsheet dll in my production code, the simplified examples I produced did have a reference to DevExpress.Office.V14.1.Core in them. None of my code has a reference to docs.

I’d be interested to try and understand why my code worked at all, with just the reference to the spreadsheet dll in place ? I’m guessing that the indexer by Name is declared in the Spreadsheet dll and the indexer by index is in the Office dll ?

Thanks for taking time to look into what was ultimately my issue…

Paul.

Yeah. I’m going to see if I can reproduce that case locally though and give a proper compiler error for the next build to avoid this issue.

The next version will give something like:

Error 1 (E326) Indirectly used type “DevExpress.Office.ISimpleCollection`1” is defined in an unreferenced assembly (DevExpress.Office.v14.2.Core, Version=14.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a) C:\Users\carlokok\Documents\Visual Studio 2013\Projects\ConsoleApplication125\Program.pas 19 3 ConsoleApplication125

whent his happens

Thanks Carlo. Hopefully that will prove useful to others too.

Paul.

bugs://71102 got closed with status fixed.