D
dean_joy
Unregistered / Unconfirmed
GUEST, unregistred user!
type
PNodeRec = ^TNodeRec;
TNodeRec = record
Comments: string;
end;
procedure TVAddItem(TreeView:TTreeview;Name:string;DataNodeRec);
begin
.....
TreeView.Items.AddObject(nil,Name,Data);
......
end;
....
New(Data);
TVAddItem(TreeView,Name,Data);
Memo_Comments.Lines.Text:=PNodeRec(treeview.Selected.Data)^.Comments;
//这里会出错
请问把指针作为参数的时候应该注意什么问题呢?
PNodeRec = ^TNodeRec;
TNodeRec = record
Comments: string;
end;
procedure TVAddItem(TreeView:TTreeview;Name:string;DataNodeRec);
begin
.....
TreeView.Items.AddObject(nil,Name,Data);
......
end;
....
New(Data);
TVAddItem(TreeView,Name,Data);
Memo_Comments.Lines.Text:=PNodeRec(treeview.Selected.Data)^.Comments;
//这里会出错
请问把指针作为参数的时候应该注意什么问题呢?