Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skipped Methods in generated Code
ref DateTime is not supported, but IIRC DateTime is (would need to look).

The normal work around is to make a simple proxy/wrapper class which returns DateTime as a result.

The second one at least makes more sense because there are multiple return values, but it would be a better design to return a class with all the values, and that is how I would suggest to wrap it as well.

Based on what I see I'm guessing the .NET library is wrapping a C/C++ library, or is written by a C/C++ developer. This API isn't within what I would consider ".NET norms" for an API.

Regarding the second case.

ref UInt16 is supported. Enums are transformed to bytes and it should generate constants in the .pas file for you to use.

Regarding the wrapper - Thats not quite what I meant. Instead of that, its much simpler.

1) Using VS, VS code or other make a C# (or other) project which connects to the target assembly which is giving you trouble.

2) Expose a new API which proxies the calls. For example, MyWrapper.GetTermRTC: DateTime or even string and if exception, throw it instead of returning it as a value. Or, return 2 values if you want to handle it that way. But CrossTalk will pass exceptions properly and that is the normal way to handle such in both .NET and Delphi.

3) Use CrossTalk to consume your wrapper which is "friendlier" both in terms of CrossTalk, but also more to the .NET norms and guidelines as well.

Messages In This Thread
Skipped Methods in generated Code - by Flo1983 - 11-27-2018, 09:45 AM
RE: Skipped Methods in generated Code - by kudzu - 11-27-2018, 02:10 PM
RE: Skipped Methods in generated Code - by kudzu - 11-28-2018, 03:19 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)