编
编程傻子
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
Stream:TResourceStream;
MyJpg: TJpegImage;
h: THandle;
begin
Try
h := LoadLibrary('Ytdll.dll');
if h <>0 then
Begin
Stream := TResourceStream.Create (H,'cgddzd',RT_RCDATA) ;
try
MyJpg:=TJpegImage.Create;
MyJpg.LoadFromStream (Stream) ;
Image1.Picture.Assign(MyJpg);
finally
MYJPG.FREE; //在这里
end;
end;
Finally
Stream.Free;//在这里
FreeLibrary(h);//在这里
end;
end;
[Warning] Unit3.pas(49): Variable 'h' might not have been initialized
[Warning] Unit3.pas(44): Variable 'MyJpg' might not have been initialized
[Warning] Unit3.pas(48): Variable 'Stream' might not have been initialized
运行没问题。
var
Stream:TResourceStream;
MyJpg: TJpegImage;
h: THandle;
begin
Try
h := LoadLibrary('Ytdll.dll');
if h <>0 then
Begin
Stream := TResourceStream.Create (H,'cgddzd',RT_RCDATA) ;
try
MyJpg:=TJpegImage.Create;
MyJpg.LoadFromStream (Stream) ;
Image1.Picture.Assign(MyJpg);
finally
MYJPG.FREE; //在这里
end;
end;
Finally
Stream.Free;//在这里
FreeLibrary(h);//在这里
end;
end;
[Warning] Unit3.pas(49): Variable 'h' might not have been initialized
[Warning] Unit3.pas(44): Variable 'MyJpg' might not have been initialized
[Warning] Unit3.pas(48): Variable 'Stream' might not have been initialized
运行没问题。