I asked the question here - updating STRING TABLE via UpdateResource (adding multiple strings)
And now I am asking again, as this time I can add alot more detail to the question.
I've been trying this for the past day or something to no real avail.
What I want the outcome to be is like this (I manually added the strings in MSVS):
As you can see, multiple entries, and it's "clean" and can be easily accessed by the program!
Right now, my source:
wstring buffer[5] = {L" Meow",L" I",L" Am",L" A",L" Dinosaur"}; // ignore the string
if (HANDLE hRes = BeginUpdateResource("Output.exe",TRUE))
{
for (int i = 0; i < 5; i++)
{
wchar_t * temp;
temp = new wchar_t[(buffer[i].length()+1)];
wcscpy(temp,buffer[i].c_str());
wcout << temp << endl;
UpdateResource(hRes,RT_STRING,MAKEINTRESOURCE(1),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
temp, 48); //buffer[i].length()+1
delete[] temp;
}
EndUpdateResource(hRes,FALSE);
}
Produces:
Which is wrong, as it seems to only have added the last string to the table, not the strings before it!
When I try modifying the source so MAKEINTRESOURCE(1) is now "MAKEINTRESOURCE(i)", the outcome is this as shown in various pictures:
Success in the fact it added all the strings, but it seems to have created various string tables which is not what was desired. Although I do notice the ID's have incremented by 16 in each picture which could possibly explain something. Basically, I want the strings to be formatted as in the first picture (with the multiple strings), but have no real idea how to do this.
Thank you for your assistance.