I want to add a text file as resource in VC++ 2005. I am not able to find text as option in resource template.
Also once added how can I refer to that file while programming?
I want to add a text file as resource in VC++ 2005. I am not able to find text as option in resource template.
Also once added how can I refer to that file while programming?
That's pretty simple: In your solution, switch to resource view, right click on your RC file, select "Add Resource", click on "Import", select "All files" then open the file you want. You're prompted to type in a custom resource type. Enter "TEXT" for example.
You can now load your custom resource like this:
HRSRC hRes = FindResource(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_TEXT1), _T("TEXT"));
DWORD dwSize = SizeOfResource(GetModuleHandle(NULL), hRes);
HGLOBAL hGlob = LoadResource(GetModuleHandle(NULL), hRes);
const BYTE* pData = reinterpret_cast<const BYTE*>(::LockResource(hgData));