Reputation: 309
I've been trying to store a few values in an RCDATA resource but I'm not sure how I am supposed to access them individually.
HGLOBAL hMem = LoadResource(hInstance,FindResource(hInstance,MAKEINTRESOURCE(IDR_RCDATA),RT_RCDATA));
PVOID lpData = LockResource(hMem);
I "think" I have successfully obtained a pointer to my data but what I'm supposed to do now, I don't know.
http://msdn.microsoft.com/en-us/library/cc194809.aspx is the only information I could find except delphi examples, neither have helped me. My RCDATA is as follows.
IDR_RCDATA RCDATA
{
10,
30
}
Anyone know how to do this?
Upvotes: 1
Views: 1839
Reputation: 942000
Such a resource has no structure, it is just a blob of bytes. It is up to you to write code that imposes a structure. None is visible in your .rc snippet so the only logical thing is to just read bytes, lpData[index]. SizeOfResource() helps you avoid indexing the blob out of bounds.
Upvotes: 3