how to create a dynamic richview object?
Posted: Fri Jan 18, 2008 6:21 am
I need to judge that a rvf's stream contains the special tag which I set.So, I create a dynamic richview object and create a instance to do it.But, there are errors in my program.
Code: Select all
function PipisheUtil.judgeRVSTREAMIsNull(rvStream: TStream): Boolean;
var
tempRV: TRichView;
tempStream:TStream;
begin
try
tempRV := TRichView.Create(nil);
tempStream:=TMemoryStream.Create;
tempStream.CopyFrom(rvStream,0);
tempStream.Position:=0; //add this ,the IDE show error
tempRV.LoadRVFFromStream(tempStream);
tempRV.Format;
if (tempStream.Size<1) or (judgeRVIsNull(tempRV)) then
begin
Result := True;
end
else
begin
Result := False;
end;
finally
tempRV.Free;
tempStream.Free;
end;
end;