Y
YJT-117
Unregistered / Unconfirmed
GUEST, unregistred user!
function TForm1.dfmFileLoad(const aFile: String): string;
var
aInput : TStream;
aOutput : TStream;
aStr : TStrings;
begin
Result := '';
aInput := TFileStream.Create(aFile, fmOpenRead);
try
aOutput := TMemoryStream.Create;
try
ObjectResourceToText(aInput,aOutput);
aOutput.Position:=0;
aStr:=TStringList.Create;
try
aStr.LoadFromStream(aOutput);
// aStr.LoadFromStream(ainput);
Result:=aStr.Text;
finally
aStr.Free;
end;
finally
aOutput.Free;
end;
finally
aInput.Free;
end;
end;
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EInvalidImage with message 'Invalid stream format'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
為什么老是報這個錯,請高手指點
var
aInput : TStream;
aOutput : TStream;
aStr : TStrings;
begin
Result := '';
aInput := TFileStream.Create(aFile, fmOpenRead);
try
aOutput := TMemoryStream.Create;
try
ObjectResourceToText(aInput,aOutput);
aOutput.Position:=0;
aStr:=TStringList.Create;
try
aStr.LoadFromStream(aOutput);
// aStr.LoadFromStream(ainput);
Result:=aStr.Text;
finally
aStr.Free;
end;
finally
aOutput.Free;
end;
finally
aInput.Free;
end;
end;
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EInvalidImage with message 'Invalid stream format'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
為什么老是報這個錯,請高手指點