IDR_GIF1 is a gif imported from resource editor.
and GIF is custom resource!
m_image.LoadFromResource(AfxGetInstanceHandle(),IDR_GIF1);//load failed!
if (!m_image.IsNull()) { m_image.BitBlt(dc,0,0); }
i also tried :
HINSTANCE hInst = AfxGetResourceHandle(); HRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(IDR_GIF1), TEXT("GIF")); // type if (!hRsrc) return FALSE;
// load resource into memory DWORD len = SizeofResource(hInst, hRsrc); BYTE* lpRsrc = (BYTE*)LoadResource(hInst, hRsrc); if (!lpRsrc) return FALSE;
// create memory file and load it CMemFile file(lpRsrc, len); m_image.Load(file.GetFilePath()); FreeResource(hRsrc); file.Close();
but still i got the same result :FAILED!
need you help:)
Visual C++9
|