Jump to content
  • Advertisement
Sign in to follow this  
staticVoid2

MFC custom resources

This topic is 771 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

Does anyone know if it is possible to add custom resource types in MFC?

 

I'm looking to batch certain resources together, a few strings and perhaps a bitmap resource under one resource ID in MFC. Looking through msdn the only thing I could find was resource templates but I believe this is for something different entirely.

 

I'd be looking to have a function similar to e.g. LoadIcon() but which returns a custom data structure for this new resource type e.g.

MyResource res;
LoadMyResource(res, <resource_id>);

Is this possible in MFC?

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I think you want this:

HRSRC WINAPI FindResource(
_In_opt_ HMODULE hModule,
_In_ LPCTSTR lpName,
_In_ LPCTSTR lpType
);

HGLOBAL WINAPI LoadResource(
_In_opt_ HMODULE hModule,
_In_ HRSRC hResInfo
);

LPVOID WINAPI LockResource(
_In_ HGLOBAL hResData
);

There is a RT_RCDATA resource type defined as 10.

Read msdn for extra info.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!