D
demogorgon
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TCheckEditProperty.Edit;
var Dlg: TStringsEditDlg;
TempStrings: TStringList;
begin
Dlg := TStringsEditDlg.Create(nil);
try
with Dlg do
begin
Dlg.Caption := 'Strings List Editor';
TempStrings := TStringList(GetOrdValue);
if TempStrings = nil then
begin
TempStrings := TStringList.Create;
end;
Dlg.Lines.Text := TempStrings.Text; //好像这句有问题
Dlg.ShowModal;
if Dlg.ModalResult = mrOK then
begin
SetOrdValue(LongInt(Dlg.Lines.Text));
end;
end;
finally
FreeAndNil(Dlg);
end;
请问哪里有问题?访问TempStrings.Text就说内存 violent,请问是什么地方出错了?
//bow
var Dlg: TStringsEditDlg;
TempStrings: TStringList;
begin
Dlg := TStringsEditDlg.Create(nil);
try
with Dlg do
begin
Dlg.Caption := 'Strings List Editor';
TempStrings := TStringList(GetOrdValue);
if TempStrings = nil then
begin
TempStrings := TStringList.Create;
end;
Dlg.Lines.Text := TempStrings.Text; //好像这句有问题
Dlg.ShowModal;
if Dlg.ModalResult = mrOK then
begin
SetOrdValue(LongInt(Dlg.Lines.Text));
end;
end;
finally
FreeAndNil(Dlg);
end;
请问哪里有问题?访问TempStrings.Text就说内存 violent,请问是什么地方出错了?
//bow