본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

MFC. 리소스 파일 관련 . Using Multiple Resource Files and Header Files with Visual C++

by i.got.it 2020. 11. 15.

 

 

 

 

 

리소스 파일에 있는 마크로부분 의미. 

 

#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.

 

 

Visual C++ starts with slightly higher values that the lowest legal value when creating a new .RC file. AppWizard will also initialize these values to something more appropriate for MFC applications. For more information about ID value ranges, see Technical Note 20.

 

Now every time you create a new resource file, even in the same project, Visual C++ defines the same _APS_NEXT_ values. This means that if you add, say, multiple dialogs in two different .RC files, it is highly likely that the same #define value will be assigned to different dialogs. For example, IDD_MY_DLG1 in the first .RC file might be assigned the same number, 101, as IDD_MY_DLG2 in a second .RC file.

 

To avoid this, you should reserve a separate numeric range for each of the four domains of IDs in the respective .RC files. Do this by manually updating the _APS_NEXT values in each of the .RC files before you start adding resources. For example, if the first .RC file uses the default _APS_NEXT values, then you might want to assign the following _APS_NEXT values to the second .RC file:

 

 

#define _APS_NEXT_RESOURCE_VALUE 2000

#define _APS_NEXT_COMMAND_VALUE 42000

#define _APS_NEXT_CONTROL_VALUE 2000

#define _APS_NEXT_SYMED_VALUE 2000

 

Of course, it is still possible that Visual C++ will assign so many IDs in the first .RC file that the numeric values start to overlap those reserved for the second .RC file. You should reserve sufficiently large ranges so that this does not happen.

 

 

 

 

from

 

 

TN035: Using Multiple Resource Files and Header Files with Visual C++

TN035: Using Multiple Resource Files and Header Files with Visual C++ In this article --> Note The following technical note has not been updated since it was first included in the online documentation. As a result, some procedures and topics might be out o

docs.microsoft.com

 

 

 

 


첫 등록 : 2020.11.15

최종 수정 : 

단축 주소 : https://igotit.tistory.com/

 


 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5