Link to home
Start Free TrialLog in
Avatar of jd9288
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?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jd9288
jd9288

ASKER

jkr, I figured it out.
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.