您的位置:首页 > 编程语言 > C语言/C++

Please be careful when include a resouce.h file to any cpp to avoid regression.

2008-11-07 09:09 681 查看


I summarize all the points that you should pay attention to before you want to include a resource.h file to any cpp.
1. You should confirm that when you define a new resource, there don’t exist the Macro Re-definition.
You can confirm this by search the new defined macro in your solution, or you can see the build log to check whether have the warning of Macro Re-definition or not, or raise the compiler parameter to set the Macro Re-definition warning as Error by Add: /WE4005 to your project build:

If the Macro have re-definition, there will exist the potential defects,
More details of this potential defects, just see the bottom of this thread.
1. When you try to load a string using LoadString, I would recommend that you specified the hInsance HANDLE as the first parameter of CString’s LoadString, this do really help us avoid some potential issues.
2. If you try to use TUxCommonUtils::LoadString(string macro definition) to load the string resource from TransUtilsRes.dll, please keep in your mind that the string macro definition should and must be defined in project TransUtilsRes/Resource.h, if the string resource is defined in other projects, you would not get that string.

This summarize just let you review and refresh your impression about load string, hope this helpful to you.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐