I adapted a function to write some object properties (in a TList) to a File stream
I think it should be possible to save Any properties in this way, it works OK for Integers, strings (fixed length) even simple enumerated types but if I Use the same method for an Icon (ObjectIco is a TIcon), it dosent work.
procedure TThings.WriteToStream(Fs : TFileStream );
begin
Fs.WriteBuffer(XPos, Sizeof(Xpos));
Fs.WriteBuffer(YPos, Sizeof(Ypos));
Fs.WriteBuffer(ObjectIco, Sizeof(ObjectIco));
end;
Does anyone know the correct way to do this ??
Steve.
I think it should be possible to save Any properties in this way, it works OK for Integers, strings (fixed length) even simple enumerated types but if I Use the same method for an Icon (ObjectIco is a TIcon), it dosent work.
procedure TThings.WriteToStream(Fs : TFileStream );
begin
Fs.WriteBuffer(XPos, Sizeof(Xpos));
Fs.WriteBuffer(YPos, Sizeof(Ypos));
Fs.WriteBuffer(ObjectIco, Sizeof(ObjectIco));
end;
Does anyone know the correct way to do this ??
Steve.