love in C++, live on MFC

to get ready...

C++博客 首页 新随笔 联系 聚合 管理
  47 Posts :: 0 Stories :: 97 Comments :: 0 Trackbacks
MFC自己定义了一些字符串,在用户自己定义字符串的时候,id不能重复。这个时候,用户自定义id的范围是什么?
今天同事问我。

我还真不知道,但是我看了下AFXRES.RC 和AFXRES.H ,发现MFC用的ID都是0xE000以上的。所以,用户自己用的,从0->0xCFFFF?不过不确定。呵呵,查了一下,正确的可以见TN020:http://msdn2.microsoft.com/en-us/library/t2zechd4.aspx
By convention, the ID value of 0 is not used.

Windows implementation limitations restrict 
true resource IDs to be less than or equal to 0x7FFF.

MFC
's internal framework implementations reserve several ranges: 0xE000->0xEFFF and 0x7000->0x7FFF.

Several Windows system commands use the range of 
0xF000 -> 0xFFFF.

Control IDs of 
1->7 are reserved by IDOK, IDCANCEL, and so on.

The range of 
0x8000->0xFFFF for strings is reserved for menu prompts for commands.


但是在我的印象中,重复的字符串id在编译的时候,就会出错的。但是http://support.microsoft.com/kb/q194299/上说,实际上,选static link mfc才会在编译的时候发现,否则发现不了。

另外:http://www.vckbase.com/article/misc/0022.htm中说,在一个rc文件中,可以同时有几种语言的资源,呵呵,我发现我傻了,每次把不同语言的资源发在不同的rc中,搞得现在好几个rc文件,每次拷贝切换烦的要死
posted on 2006-06-13 00:25 flyingxu 阅读(1581) 评论(0)  编辑 收藏 引用 所属分类: VC/MFC

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理