I have an MFC application having a custom XML resource.
At some point I want to update the values in the XML tags/or whole XML file.
I am using following code:
UpdateResource(NULL ,_T("RT_RCDATA"), MAKEINTRESOURCE(IDR_XML), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPVOID)bytes, dwBytesWritten);
where bytes contains the new data for the file (replacing whole content of the file as couldn't get to a particular tag.)
But its not working and giving error-code 87 (ERROR_INVALID_PARAMETER) Also tried giving the current exe handle as first param in UpdateResource But it ofcourse returned Access Denied error.
So I am kinda stuck here and just wanna know is there an easy(or hard) way to update resources within the application? Any help would be appreciated.