Click here to Skip to main content
15,868,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am refactoring some legacy C++ code and see such statements from a resource.h header file:

//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by COMIntro.rc
//
#define IDS_HELLO                       1

// 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         1000
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif


I think I can remove these #ifdef statements etc., but my question is : for what is initial usage of these statements? maybe I lost some history of this.

try to get some insights from experts and gurus here.

Thanks a million.

What I have tried:

remove these statements and see no issue after compilation:
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1000
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
Posted
Updated 5-Nov-20 15:05pm

Those are used by the resource editor to assign identifiers to new controls. For example, if you add a button to a control it will be assigned the ID 1000 - the next control value.

If you are not going to edit the resource file at all you can safely delete them but there is little if any advantage to be gained so I wouldn't bother.
 
Share this answer
 
Comments
Southmountain 5-Nov-20 21:20pm    
thank you for the information! I got it.
Better not remove them else your resource editor, UI designer and ClassWizard will fail to open.
 
Share this answer
 
Comments
Southmountain 5-Nov-20 21:20pm    
thank you!
Rick York 6-Nov-20 0:37am    
This is NOT true. I have several files that do not have those macros defined and there are no problems with them of any kind.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900