C
chongdzp
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
s: string;
FileHandle: Integer;
p, Bufferointer;
Fname:string;
begin
// Buffer:= allocmem(226 + 1);
GetMem(p,444);
fname:=ExtractFilePath(application.ExeName)+'mm.txt';
if FileExists(fname) then
FileHandle:=FileOpen(fname,fmOpenRead)
else
raise exception.Create(' open file error!');
FileSeek(FileHandle,0,0);
FileRead(FileHandle,p, 35);
//以下2句释放申请的内存出现错误?
// Dispose(p);
// FreeMem(p);
FileClose(FileHandle);
end;