MFC custom resources

Started by
0 comments, last by Fredericvo 7 years, 10 months ago

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.

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.

This topic is closed to new replies.

Advertisement