Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with List of Objects
#1
Hi All,

I am currently evaluating Crosstalk for our companys use, and am having an issue with generating one of our .NET DLL classes.

Crosstalk correctly creates the base classes, but the class also has a property that is a list of objects that is not generating.
ie It creates base classes of TagReport and Tag. TagReport should contain a List of Tag objects but this appears to not be generating.

On Crosstalk generate screen I get a message "Type: TagReport. Property: Tags. skipping Generic Type"
Am I missing any required types for mscorlib in order to generate lists or something?

Am currently using Trial version 2.0.27


Cheers
Reply
#2
As per the website generics are not supported. The other "big" not supported item is interfaces.

Delphi generics are implemented very differently and are more limited than .NET generics and we are not able to simply translate them one for one. For example in .NET strings and integers can be made compatible with object so generics work on "object", while in Delphi native types are handled differently in generics than objects and it creates a lot of limitations with how they are used. Its an issue we have repeatedly looked at.

We have tried several approaches and while we were successful in exporting some generic behavior, it was not "up to par" in our view and the work required to complete it was significant. As a language feature, Generics have also progressed from D2009 forward and each compiler with regard to generics has varying level of support and some older ones like D2009 have both some very big limitations not present in newer IDEs, and for at least 2009 and 2010 some nasty compiler bugs specific to generics. Internally CrossTalk did use some generics (I don't remember if we kept it or not) in its own code and for 2009/2010 support we had to apply a few hacks and work arounds to even use generics from within plain Delphi code itself.

To get around the limitation many users create a simple wrapper in .NET which exposes the functionality they need without generics and then consume that wrapper using CrossTalk. CrossTalk can "use" generics inside .NET code, but it is unable to expose generic interfaces to Delphi.

While that might seem like a pain, its actually quite easy in most cases and works very well. In fact still better than most other options which are even more limited than CrossTalk.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)