Re: LoadImage(LR_LOADFROMFILE) fails with no error
- From: "Ian Boyd" <ian.msnews010@xxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 09:23:44 -0400
"Ian Boyd" <ian.msnews010@xxxxxxxxxxxx> wrote in message
news:OIPEtOP8IHA.5624@xxxxxxxxxxxxxxxxxxxxxxx
Calling:
LoadImage(0, 'c:\samplebmp.bmp', IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
returns no handle (0), and GetLastError returns 0.
The file exists.
The file is a bmp.
What more does it want?
The code that fails:
var
szFilename: string;
hCurrentBmp: HBITMAP;
hr: HRESULT;
begin
szFilename := 'c:\samplebmp.bmp';
hCurrentBmp := LoadBitmap(0, PChar(szFilename));
if hCurrentBmp = 0 then
begin
hr := GetLastError;
MessageDlg('Error '+IntToStr(hr)+' loading bitmap "'+szFilename+'":
'+SysErrorMessage(hr), mtError, [mbOk], 0);
end;
end;
.
- References:
- LoadImage(LR_LOADFROMFILE) fails with no error
- From: Ian Boyd
- LoadImage(LR_LOADFROMFILE) fails with no error
- Prev by Date: Re: LoadImage(LR_LOADFROMFILE) fails with no error
- Next by Date: Re: How can i get the dimensions of an HICON?
- Previous by thread: Re: LoadImage(LR_LOADFROMFILE) fails with no error
- Next by thread: Re: LoadImage(LR_LOADFROMFILE) fails with no error
- Index(es):
Loading