Answer the question
In order to leave comments, you need to log in
Delphi end of string after conversion?
This is how I attach data to TTreeNode ,
node := tv1.Items.Add(nil,qry1.FieldByName('title').AsString);
node.Data:=Pointer(string(filePath+qry1.FieldByName('file').AsString));
procedure TFormGlobal.tv1Change(Sender: TObject; Node: TTreeNode);
var file__,PATH__:String;
begin
if Assigned(Node) then begin
file__:= string(Node.Data); /////////<-
Answer the question
In order to leave comments, you need to log in
Those. the line is created in one procedure, and pulled out in another? And who will allocate memory, free it? It's strange that it works at all.
Wish it was so
procedure TForm13.Button1Click(Sender: TObject);
var
n:TListItem;
s:^String;
begin
n:=ListView1.Items.Add;
n.Caption:='test node';
New(s);
s^:='test test test';
n.Data:=s;
end;
if n.Data<>nil then
begin
s:=n.Data;
ShowMessage(s^);
Dispose(s);
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question