LoadString(nID) Problem and Solution
来源:互联网 发布:日程管理app 知乎 编辑:程序博客网 时间:2024/04/28 10:14
CString::LoadString(UINT nID)
Conclusion: the correct way to load string resource by ID is to call CString::LoadString(HINSTANCE hInstance,UINT nID), specifying the dll handler you want to search for.
Problem
CString::LoadString(UINT nID) will first use the instance handle of the main application to search for a string with the given ID. Failing that, it will look in DLLs in the order they were loaded until there is a match. If DLL A is loaded, then B and C, calling LoadString from DLL C will first find a matching resource in DLL A before finding its own resource.
Solution
Use CString::LoadString(HINSTANCE hInstance,UINT nID) or ::LoadString() function.
Another seem-to-work way (not suggested):
CString strTemp;
AFX_MANAGE_STATE(AfxGetStaticModuleState());
strTemp.LoadString(uID);
Conclusion: the correct way to load string resource by ID is to call CString::LoadString(HINSTANCE hInstance,UINT nID), specifying the dll handler you want to search for.
Problem
CString::LoadString(UINT nID) will first use the instance handle of the main application to search for a string with the given ID. Failing that, it will look in DLLs in the order they were loaded until there is a match. If DLL A is loaded, then B and C, calling LoadString from DLL C will first find a matching resource in DLL A before finding its own resource.
Solution
Use CString::LoadString(HINSTANCE hInstance,UINT nID) or ::LoadString() function.
Another seem-to-work way (not suggested):
CString strTemp;
AFX_MANAGE_STATE(AfxGetStaticModuleState());
strTemp.LoadString(uID);
- LoadString(nID) Problem and Solution
- Problem and Solution Code Snippets
- An IBM MQ problem and solution (Broker)
- UVa Problem Solution: 10018 - Reverse and Add
- 【OpenStack】OpenVswitch GRE MTU problem and solution
- CSharp - Memory leaks problem detection and solution
- Deadlock: the problem and a solution
- Accessible XHTML and CSS Web Sites Problem Design Solution
- JDBC Metadata, MySQL, and Oracle Recipes: A Problem-Solution Approach
- Ajax and REST Recipes: A Problem-Solution Approach
- A problem during the compilation of Lemur and the solution
- Solution to Articulation Points, Bridges, and Biconnected Components Problem
- B. Arpa’s obvious problem and Mehrdad’s terrible solution
- Arpa’s obvious problem and Mehrdad’s terrible solution CodeForces
- Arpa’s obvious problem and Mehrdad’s terrible solution (CodeForces
- Arpa’s obvious problem and Mehrdad’s terrible solution
- Arpa’s obvious problem and Mehrdad’s terrible solution
- Arpa’s obvious problem and Mehrdad’s terrible solution
- 直接下载豆瓣fm的全部歌曲py脚本。(json操作)
- Oracle的Environment variable:"path" 失败问题
- 应用内支付
- 【搜索】拯救ice-cream
- Struts2 MVC
- LoadString(nID) Problem and Solution
- page49
- 【搜索】油滴扩展
- eclipse乱码问题
- 用VIM编写C/C++程序
- [影评]《大话西游》之:你看,那人好像一只狗耶(外一篇:我们都是那只流泪的猴子。)
- 手机四种刷机方法
- 解决XP“网上邻居”、“查看工作组计算机”打不开的问题
- Xming + PuTTY 在Windows下远程Linux主机使用图形界面的程序