RichView13.12 Stream read error 原因分析
来源:互联网 发布:msn聊天软件 编辑:程序博客网 时间:2024/06/04 23:36
RichView13.12 Stream read error
有选中文本时,调用RichViewEdit1.GetSelText;方法会报错,
发现这个版本最终调用
function TCustomRVFormattedData.GetSelTextR(Unicode: Boolean): TRVRawByteString;
var Stream: TRVMemoryStream;
begin
{$IFNDEF RVDONOTUSEINPLACE}
if (GetChosenRVData<>nil) then begin
Result := TCustomRVFormattedData(GetChosenRVData).GetSelTextR(Unicode);
exit;
end;
{$ENDIF}
if not SelectionExists(False, True) then begin
Result := '';
exit;
end;
Stream := TRVMemoryStream.Create;
try
if SaveTextToStream('', Stream, 80, True, True, Unicode, False, CP_ACP, True) then begin// RVMemoryStream.Write
SetLength(Result, Stream.Size);
Stream.Position := 0;
Stream.ReadBuffer(PRVAnsiChar(Result)^, Stream.Size);
end
else
Result := '';
finally
Stream.Free;
end;
end;
write函数由于子类TRVMemoryStream有重载,所以调用了子类的write方法,对子类的Fsize赋值了,就不调用父类的write方法了,Fsize是TRVMemoryStream的私有成员,所以父类的Fsize并未赋值。导致后面调用父类TStream.ReadBuffe函数时,Fsize为0,子类没有相应的readbuffer函数,只能调用父类的read函数,所以你类函数后面报错了。最新版本XE4增加了重载ReadBuffer函数,这样最终Read调用了子类TRVMemoryStream的Read方法,完成了读功能,而不调用父类的read方法,所以就不出错了。
- RichView13.12 Stream read error 原因分析
- stream:error (text) 错误分析
- Internal server error原因分析
- java.io.IOException: Attempted read on closed stream.可能原因及解决方案
- jxl.read.biff.BiffException: Unable to recognize OLE stream原因及解决方法
- Stream.Read 方法
- 浅谈 Stream.Read 方法
- loadFileSystems error & ExceptionUtils错误原因分析
- loadFileSystems error & ExceptionUtils错误原因分析
- Media start error原因分析及解决方法
- c# stream.read 的使用!
- libpng Error:read error
- error: fd0 read error
- Error: "Corrupt Portfolio Stream"
- Flex Error #2032 Stream Error
- Java IO学习【12】字节流byte Stream的基本write/read学习
- Serialize / Stream (Read/Write) Configuration Settings
- 关于stream.read(ab, 0, BLOCK)
- 将输入的阿拉伯数字转换的汉字的大写输出
- Mongodb集群搭建的三种方式
- Javascript--刷新页面的多种方法
- 深入理解Android Sensor系统 (4.0)
- MySQL对日期时间类型的处理和限制
- RichView13.12 Stream read error 原因分析
- ECshop新手入门模板制作教程[转载]
- ECShop 2.5.1 的结构图及各文件相应功能介绍
- myeclipse工具注册序列号程序
- ecshop二次开发的简单快速入门教程
- ECSHOP_布局参考图_模板结构说明(全面)
- ....智能的列表分页,两行代码轻松实现....
- Hive基本命令整理
- SSRS报表服务器的安装与部署