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

来源:互联网 发布:淘宝裤子50字评价 编辑:程序博客网 时间:2024/05/17 21:49
 

               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.

原创粉丝点击