VS资源(基础)

1. 资源Basic

Visual C++ 支持十种资源:加速键、位图、光标、对话框、HTML、图标、菜单、串表、工具条和版本信息。            各种资源就是堆数据而已,最终都会被嵌入到EXE文件里的数据区中。需要的时候就通过函数加载到内存中使用。和数据库一样的。各种资源通过ID来唯一确 定,就像数据库用关键字来确定一样。不同的资源由于类型不一样可以使用等值的ID,如同数据库里的每一个表单里的关键字值不唯一,但不同表单的关键字是允 许一样的。

2. Next ID Issue

RC文件中,都有如下一段宏定义:

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif

#endif

这些宏的含义在于为资源编辑器维护下一个resource, command, control and symbol的ID,从而使得在可视化编辑器里编辑、添加任何资源时,ID的分配遵循统一的规则。

Note:

1. When adding a rc file to an empty dll project, VC will generate a filename.rc file and two files automatically: resource.h and filename.aps.

2. Even direclty adding string table items by editor, the next resource id is not the next id after current max string ID. It can be easily found by a try.

[摘自:http://msdn.microsoft.com/en-us/library/6t3612sk(VS.80).aspx]

For any given .RC file, Visual C++ incrementally assigns IDs in each of four ID domains. Between editing sessions, Visual C++ keeps track of the last ID it assigned in each of the domains in the symbol header file for the .RC file. Here is what the APS_NEXT values are for an empty (new) .RC file:

#define _APS_NEXT_RESOURCE_VALUE  101

#define _APS_NEXT_COMMAND_VALUE 40001

#define _APS_NEXT_CONTROL_VALUE 1000

#define _APS_NEXT_SYMED_VALUE 101

_APS_NEXT_RESOURCE_VALUE is the next symbol value that will be used for a dialog resource, menu resource, and so on. The valid range for resource symbol values is 1 to 0x6FFF.

_APS_NEXT_COMMAND_VALUE is the next symbol value that will be used for a command identification. The valid range for command symbol values is 0x8000 to 0xDFFF.

_APS_NEXT_CONTROL_VALUE is the next symbol value that will be used for a dialog control. The valid range for dialog control symbol values is 8 to 0xDFFF.

_APS_NEXT_SYMED_VALUE is the next symbol value that will be issued when you manually assign a symbol value using the New command in the Symbol Browser.

转载于:https://www.cnblogs.com/taoxu0903/archive/2009/04/13/1435146.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值