Atozed Forums
Issue with StringArray property - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: CrossTalk (https://www.atozed.com/forums/forum-2.html)
+---- Forum: CrossTalk General Discussion (https://www.atozed.com/forums/forum-7.html)
+---- Thread: Issue with StringArray property (/thread-688.html)

Pages: 1 2 3


Issue with StringArray property - Jofreeze - 09-24-2018

Hello,
I have an issue reading a property declared as array of strings.


My unit (generated by CrossTalk ClassGen) contains a property AllIDs: StringArray read AllIDsRead:

Code:
function SelectionChangedEventArgs.AllIDsRead: StringArray;
begin
  with TRight.GetPropValue(Self, '', 'AllIDs') do try
    Result := NET.mscorlib.StringArray(Results.ReadObject);
  finally Free; end;
end;


When this function is called, I get an exception from:

\CrossTalk\Source\Atozed.CrossTalk.Streams.pas

function TCTStreamReader.ReadObject(aClass: TClass = nil): TObject;
 -> raise ECTException.Create('Unknown type found during unboxing.');

because xType = dtObjectList {205}

I also have a function returning an StringArray (not a property), and this one works without error:

Code:
function FAL_GAN_LINK.GetAllDataRecordsIds: StringArray;
begin
  with TRight.MethodCall(Self, '', 'GetAllDataRecordsIds', 0) do try
    Result := NET.mscorlib.StringArray(Results.ReadObject);
  finally Free; end;
end;

with xType = dtNewObject {206} in ReadObject.

Is it a bug with StringArray properties?


RE: Issue with StringArray property - kudzu - 09-24-2018

Can you make a simple ready to run demo (console project please) and send me the DPR and CTP file? You can code it all in the DPR to avoid even needing a .pas file.


RE: Issue with StringArray property - Jofreeze - 02-08-2019

Hello,
It took some time, but the sample project is here.
Can you take a look at it?
Thanks


RE: Issue with StringArray property - kudzu - 02-11-2019

What version of Delphi are you using? This project when I loaded it said it wanted to upgrade from D2007. D2007 has not been supported by CrossTalk for several years.


RE: Issue with StringArray property - Jofreeze - 02-12-2019

We use Delphi 10.2. I didn't include .dproj file in zip, it may be the reason of message?


RE: Issue with StringArray property - kudzu - 02-12-2019

Possibly. I will proceed without it. I just needed to verify that you were not using an old unsupported IDE.


RE: Issue with StringArray property - kudzu - 02-13-2019

Is it correct that this assembly is compiled as x64 only? If so is there a reason for this? Except in rare cases, .NET assemblies should be ANY and not X64 or X86.

CrossTalk does support X64, but it takes me a lot longer to debug as I have to change the dev test environment.

I assume this is a test assembly of yours? If so, is it possible to rebuild as ANY instead of X64?

// TestStringArrayProperty, Version=1.0.6978.15731, Culture=neutral, PublicKeyToken=null

// Global type: <Module>
// Architecture: x64
// Runtime: .NET 4.0


RE: Issue with StringArray property - Jofreeze - 02-19-2019

The dll just contains MyClass.cs, you can recompile it.
This one is compiled with ANY.


RE: Issue with StringArray property - kudzu - 02-21-2019

Thanks. My dev day is already scheduled today but I will get to this as soon as I can.


RE: Issue with StringArray property - kudzu - 02-26-2019

I've scheduled this into my dev day today.