I want to store positions of some objects in resource file and I've decided to store it in STRINGTABLE resource, because I couldn't find better type. My resource file:
#include "resource.h"
// POSITIONS_ID = 10 defined in resource.h
STRINGTABLE
{
POSITIONS_ID "100 100 \
200 350 \
400 800"
}
I've tried to get this string differently, but the problem is the same One of my attempts:
char* data = new char[100];
int length = LoadStringA(NULL, POSITIONS_ID, data, 100); // length = 0
cout << GetLastError() << endl // out 0, so there aren't any errors
// but data = "\0"
I've also tried to use wchar_t
as type of data with LoadStringW
function, but result is the same. I've tried GetModuleHandle(NULL)
instead of NULL
too.
I don't understand what is wrong.
Some more information:
HRSRC r = FindResource(Null, MAKEINTRESOURCE(POSITIONS_ID), RT_STRING) // return 0;
cout << GetLastError() << endl; // return 1814(The specified resource name cannot be found in the image file.)
So problem is that resource can't be found, but I still don't understand why.