The question is closed (answer accepted) replaced by Delphi 7: Access violation - TByteDynArray problem )
I have the following delcartion given to me
MyPhoto = class(TRemotable)
private
FhasPhoto: Boolean;
FphotoData: TByteDynArray;
published
property hasPhoto: Boolean read FhasPhoto write FhasPhoto;
property photoData: TByteDynArray read FphotoData write FphotoData;
end;
I want too
var photo : MyPhoto;
photo := MyPhoto.Create();
SetLength(photo.photoData, 4);
but i get
[Error] mainForm.pas(340): Constant object cannot be passed as var parameter
1) How to encode it correctly, given that I cannot change the definition of the Photo class?
2) can I effectively "dump" any structure in TByteDynArray by simply assigning it?
(as you might have guessed, I'm a BCB guy trying to get into Ddlphi :-)
ps I agree to be able to assign each byte of photo data individually ...
source
share