Click to See Complete Forum and Search --> : UpdateResource API help needed


RPR
April 27th, 1999, 09:12 AM
Can anyone help me update a specific field in a version resource? From a code example in MSDN, I can see how to replace an entire resource such as a dialog via the UpdateResource function, but how can I just update specific fields or string resources?

Using the UpdateResource function, I am trying to change a couple of the version fields (in this example, CompanyName). The following code is wrong, but this is what I'd like to do:

char* lpData = "blah";

HANDLE hUpdateRes = ::BeginUpdateResource((LPCTSTR)m_fileName, FALSE);

BOOL rc = ::UpdateResource(
hUpdateRes,
RT_VERSION,
"CompanyName",
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
lpData,
sizeof(lpData));

rc = EndUpdateResource(hUpdateRes, FALSE);

Thank you in advance,

Bob