我正在尝试将字符串转换为TStream.我的下面的代码在CopyFrom行上给我一个“抽象错误”消息.我在这里碰壁砖,有关如何解决这个问题的想法吗?
procedure StringToStream(const AString: string; out AStream: TStream); var SS: TStringStream; begin SS := TStringStream.Create(AString); try SS.Position := 0; AStream.CopyFrom(SS,SS.Size); //This is where the "Abstract Error" gets thrown finally SS.Free; end; end;