jd9288
asked on
ifstream from resource
Need to get ifstream from resource.
I have this:
int LoadResource (UINT res, char * szres)
{
......
HINSTANCE hInst = AfxGetResourceHandle();
HRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(res), szres);
BYTE* lpRsrc = (BYTE*)LoadResource(hInst, hRsrc);
......
}
How do I get ifstream from this?
I have this:
int LoadResource (UINT res, char * szres)
{
......
HINSTANCE hInst = AfxGetResourceHandle();
HRSRC hRsrc = ::FindResource(hInst, MAKEINTRESOURCE(res), szres);
BYTE* lpRsrc = (BYTE*)LoadResource(hInst,
......
}
How do I get ifstream from this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I needed to load animated GIF file from resource, and I had the code
how to load it from disk (WINIMAGE.CPP by Juan Soulie), so I just used memcpy on the byte array to manually
do what the ifstream does.
I wanted to know if there was an easy way out, and you answered that.
Thanks.