C
czx_china
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Node:TTreeNode;
Ms: TMemoryStream;
Md: TMemoryStream;
CurrDD:TDD;
begin
if FileExists(ExtractFilePath(Application.ExeName)+'ss.dd') then
begin
Ms:=TMemoryStream.Create;
Ms.LoadFromFile(ExtractFilePath(Application.ExeName)+'ss.dd'');
Ms.Read(CurrDD,sizeof(TDD));
TreeView.Items.Clear;
Node:=TreeView.Items.Add(nil,'节点1');
Md := TMemoryStream.Create;
Md.Write(CurrDD,sizeof(TDD));
Node.Data:=Md;
Node.ImageIndex := 0;
Node.SelectedIndex := 0;
搞不明白为什么关闭EXE的时候老是有个错误,Ms.Read(CurrDD,sizeof(TDD));去了这个就没有问题,可是就不能用CurrDD来传递参数了,很困惑,这倒低是怎么回事啊?
TreeView.Selected:=Node;
TreeView.SetFocus;
Ms.Free;
Node:TTreeNode;
Ms: TMemoryStream;
Md: TMemoryStream;
CurrDD:TDD;
begin
if FileExists(ExtractFilePath(Application.ExeName)+'ss.dd') then
begin
Ms:=TMemoryStream.Create;
Ms.LoadFromFile(ExtractFilePath(Application.ExeName)+'ss.dd'');
Ms.Read(CurrDD,sizeof(TDD));
TreeView.Items.Clear;
Node:=TreeView.Items.Add(nil,'节点1');
Md := TMemoryStream.Create;
Md.Write(CurrDD,sizeof(TDD));
Node.Data:=Md;
Node.ImageIndex := 0;
Node.SelectedIndex := 0;
搞不明白为什么关闭EXE的时候老是有个错误,Ms.Read(CurrDD,sizeof(TDD));去了这个就没有问题,可是就不能用CurrDD来传递参数了,很困惑,这倒低是怎么回事啊?
TreeView.Selected:=Node;
TreeView.SetFocus;
Ms.Free;