• 13
• 15
• 27
• 9
• 9

# text file as resource?

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

## Recommended Posts

Does anyone know if you can add a text file as a win32 resource? If so, how would I load the text file from the resource?

##### Share on other sites
Hi,

You can add the text file (or whatever file in fact) in the resource file using user defined resources.

HRSRC hrsrc = FindResource(NULL, my_name, my_user_type);HGLOBAL hresdata = LoadResource(NULL, hrsrc);char *pText = (char *)(LockResource(hresdata);

It is not necessary to unlock the resource after that.

HTH,