Original Post
Hello, my program contains some text files as resources in binary format (RT_RCDATA) and I'm trying to load them at runtime.
From what I understand, LockResource returns a pointer to the first byte of the resource, but how do I read all of the bytes and store them in a string or char array? I can't find any good examples on the net
From what I understand, LockResource returns a pointer to the first byte of the resource, but how do I read all of the bytes and store them in a string or char array? I can't find any good examples on the net
HMODULE module = GetModuleHandle(NULL);
HRSRC resInfo = FindResource(module, MAKEINTRESOURCE(resourceID), RT_RCDATA);
DWORD resSize = SizeofResource(module, resInfo);
HGLOBAL resHandle = LoadResource(module, resInfo);
char *resData = (char*)LockResource(resHandle);
// ...?