X
XYong
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button3Click(Sender: TObject);
var
p : PWideChar;
c : string;
begin
c := 'test';
GetMem(p,Length(c)+1);
try
StringToWideChar(c,p,Length(c)+1);
finally
FreeMem(p);
end;
end;
执行这段代码时,无论是否FreeMem(p) 却报 非法指针 操作windows2000+delphi6
why !!!!!!!!!!!!!!!!!!!
var
p : PWideChar;
c : string;
begin
c := 'test';
GetMem(p,Length(c)+1);
try
StringToWideChar(c,p,Length(c)+1);
finally
FreeMem(p);
end;
end;
执行这段代码时,无论是否FreeMem(p) 却报 非法指针 操作windows2000+delphi6
why !!!!!!!!!!!!!!!!!!!