比如
TUIMsg = record
nCurRow : integer;
nCurCol : integer;
sInfo : String; //other infomation
end;
TUIMsgPointer = ^TUIMsg;TRichEdit2 = class(TRichEdit)
private
// Msg:LongInt;{ Private declarations }
FnMaxRow:Integer;
procedure SetnMaxRow(const Value: Integer);
protected{ Protected declarations }
public
UIMsgPointer:TUIMsgPointer;{ other fields and methods}
public
constructor Create(AOwner: TComponent); override;
procedure wndproc(var message:Tmessage);override;
property nMaxRow:Integer read FnMaxRow write SetnMaxRow;
{ Public declarations }published{ Published declarations }
end;procedure Register;implementationprocedure Register; begin
RegisterComponents('Temp', [TRichEdit2]);
end;....(略)constructor TRichEdit2.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
//UIMsgPointer := TUIMsgPointer.Create(Self);
UIMsgPointer.nCurRow:=-1;
UIMsgPointer.nCurCol:=-1;
UIMsgPointer.sInfo:='';
end;....(略)因为该控件重载了procedure wndproc(var message:Tmessage);override;
而期间可能会对UIMsgPointer.nCurRow等进行操作。所以想知道他们应该在
什么地方被初始化好。如果照上面的代码,编译不会有问题,但是
当添加好后,
如果新建一个form,把TrichEdit2控件拖一个实例到form上会立刻报异常
不清楚why。
希望ggjjddmm们指点下。OS=2k Server+D7
TUIMsg = record
nCurRow : integer;
nCurCol : integer;
sInfo : String; //other infomation
end;
TUIMsgPointer = ^TUIMsg;TRichEdit2 = class(TRichEdit)
private
// Msg:LongInt;{ Private declarations }
FnMaxRow:Integer;
procedure SetnMaxRow(const Value: Integer);
protected{ Protected declarations }
public
UIMsgPointer:TUIMsgPointer;{ other fields and methods}
public
constructor Create(AOwner: TComponent); override;
procedure wndproc(var message:Tmessage);override;
property nMaxRow:Integer read FnMaxRow write SetnMaxRow;
{ Public declarations }published{ Published declarations }
end;procedure Register;implementationprocedure Register; begin
RegisterComponents('Temp', [TRichEdit2]);
end;....(略)constructor TRichEdit2.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
//UIMsgPointer := TUIMsgPointer.Create(Self);
UIMsgPointer.nCurRow:=-1;
UIMsgPointer.nCurCol:=-1;
UIMsgPointer.sInfo:='';
end;....(略)因为该控件重载了procedure wndproc(var message:Tmessage);override;
而期间可能会对UIMsgPointer.nCurRow等进行操作。所以想知道他们应该在
什么地方被初始化好。如果照上面的代码,编译不会有问题,但是
当添加好后,
如果新建一个form,把TrichEdit2控件拖一个实例到form上会立刻报异常
不清楚why。
希望ggjjddmm们指点下。OS=2k Server+D7
解决方案 »
- 求教摇号程序
- delphi 获取网页元素某input的name属性值,然后做相应的操作
- 有没有人有兴趣做个《航空霸业3》玩玩啊?
- 修改基于BDE的单文件系统数据库PARADOX,急,解决给现金
- 为什么DELPHI的工作这么难找?郁闷!
- 怎样使用Socket编写点对点的聊天程序?
- 我有两个菜鸟问题,想请教各位大虾门,请多多指点!!!
- 做完安装程序,为什么客户端生成的BDE中有我建的别名,但没有进行设置,为什么?
- 在Websnap中加入一个login的登入页面总是不成功,有没有高手能指点一下,绝对给分。有兴趣的也可以进来讨论一下。
- Excel的問題?
- 东风破
- MonthCalendar保存到数据库中
你定義為一個指針,
所以, 在create 中這樣就可
constructor TRichEdit2.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
New(UIMsgPointer);
UIMsgPointer.nCurRow:=-1;
好像不用释放?
UIMsgPointer怎么释放?
直接赋nil?
FnMaxRow:Integer;整数型也需要释放吗?不知道