Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My purpose is to change my.dll(language is chs(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED))) to cht(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)。 So I use UpdateResource to change stringtable in my.dll。

But i got two stringtable,one chs,which is empty;one cht,behaves well。

I don't know how to delete chs stringtable,any advice is grateful。

What I have tried:

part code:


BYTE* lpResData = (BYTE*)LockResource(hStringtableRes);

INT nResSize = SizeofResource(hDLL, hRes);

ChangeResLanguage(lpResData, nResSize);

UpdateResource(hUpdateRes, RT_STRING, lpName, CHS, NULL, 0);

UpdateResource(hUpdateRes, RT_STRING, lpName, CHT, lpResData, nResSize);
C++

Posted
Updated 28-Aug-18 14:57pm
v2
Comments
Richard MacCutchan 28-Aug-18 9:35am    
It is better to change the source and rebuild the dll.
Member 13957642 30-Aug-18 1:24am    
The dll is provided by a third party. I only know the language of dll is cht。

1 solution

The best solution is to use different dll and load them with LoadLibrary. Patching in files is problematic and can lead to trouble when the rights arent available or anti-virus software may detect that as attack.
 
Share this answer
 
Comments
Member 13957642 28-Aug-18 21:17pm    
Thanks, KarstenK.
I indeed wanna change my.dll to mycht.dll. my.dll has a lot strings, so i want to create a tool to change language.
Then i use the part code above. menu,dialog,version,html behaves well. just stringtable occurs a problem.

Then in my exe, i will use loadlibrary for diffrent dll.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900