was habe ich wieder falsch gemacht! Ich bekomme ständig ein Access Violation Fehler!!
<br>
<pre>
unit PCIDSK;
interface
uses Sysutils,classes;
type TPix = class(TObject)
id:array[0..63] of char;
function getid:string;
constructor createPix(pix:string) ;
end;
implementation
constructor TPix.createPix(pix:string);
var
pixfile:TStream;
begin
inherited Create;
pixfile:=Tfilestream.Create(pix,fmOpenRead);
pixfile.Position:=49;
pixfile.Read(id,sizeof(id));
pixfile.free;
end;
function TPix.getid:string;
begin
result:=id;
end;
end.
</pre>
<br>
<pre>
unit PCIDSK;
interface
uses Sysutils,classes;
type TPix = class(TObject)
id:array[0..63] of char;
function getid:string;
constructor createPix(pix:string) ;
end;
implementation
constructor TPix.createPix(pix:string);
var
pixfile:TStream;
begin
inherited Create;
pixfile:=Tfilestream.Create(pix,fmOpenRead);
pixfile.Position:=49;
pixfile.Read(id,sizeof(id));
pixfile.free;
end;
function TPix.getid:string;
begin
result:=id;
end;
end.
</pre>
Comment