resource.h values 
Author Message
 resource.h values

Are the values defined in resource.h supposed to be unique values?  I
notice a lot of them are the same for different resource ID's.

What would happen if one were to go in and change them all to different
values?

Conversely, what would be the result if two values that needed to be
different were not so?

TIA,
Jeff Klopotic

//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MvTest.rc
//
#define IDD_ABOUTBOX                    100
#define IDP_OLE_INIT_FAILED             100
#define IDR_MAINFRAME                   128
#define IDR_MVTESTTYPE                  129
#define IDR_MV1                         130
#define IDD_DIALOG_SPIN                 130 //<-- I added this dialog
box at a later time
                                                // but it was assigned the same value as a menu
#define IDR_MV2                         131
#define IDR_MV3                         132
#define IDR_MV4                         133



Sat, 28 Feb 2004 06:49:08 GMT  
 resource.h values
There are many different 'namespaces' inside resource.h. Menus and
dialogs do not conflict because they are different resource types.
Quote:

> Are the values defined in resource.h supposed to be unique values?  I
> notice a lot of them are the same for different resource ID's.

> What would happen if one were to go in and change them all to different
> values?

> Conversely, what would be the result if two values that needed to be
> different were not so?

> TIA,
> Jeff Klopotic

> //{{NO_DEPENDENCIES}}
> // Microsoft Developer Studio generated include file.
> // Used by MvTest.rc
> //
> #define IDD_ABOUTBOX                    100
> #define IDP_OLE_INIT_FAILED             100
> #define IDR_MAINFRAME                   128
> #define IDR_MVTESTTYPE                  129
> #define IDR_MV1                         130
> #define IDD_DIALOG_SPIN                 130 //<-- I added this dialog
> box at a later time
>                                                 // but it was assigned the same value as a menu
> #define IDR_MV2                         131
> #define IDR_MV3                         132
> #define IDR_MV4                         133



Sat, 28 Feb 2004 13:44:47 GMT  
 resource.h values

Quote:
> Are the values defined in resource.h supposed to be unique values?  I
> notice a lot of them are the same for different resource ID's.

Yes they should be unique

Quote:
> What would happen if one were to go in and change them all to different
> values?

They should be unique so you should change them

Quote:
> Conversely, what would be the result if two values that needed to be
> different were not so?

Well if, for example, you have 2 buttons with the same ID the system will
not what to do.
Maybe only one of the buttons would work, maybe both would?
It depends who would intersept the message for it.

The same problem might happen with a menu item.

But in most cases you don't notice what happens because one ID is for a
button and the other is for a menu item and both are not used at the same
time so there is no confusion

Quote:
> #define IDD_ABOUTBOX                    100
> #define IDP_OLE_INIT_FAILED             100
> #define IDR_MAINFRAME                   128
> #define IDR_MVTESTTYPE                  129
> #define IDR_MV1                         130
> #define IDD_DIALOG_SPIN                 130 //<-- I added this dialog
> box at a later time
> // but it was assigned the same value as a menu
> #define IDR_MV2                         131
> #define IDR_MV3                         132
> #define IDR_MV4                         133

You can see that Menu item will never be used at the same time as the dialog
box. Even a modeless dialog box will not have focus at the same time as the
menu.

I would change the numbers to make sure that it does not get out of hand.

BTW VC++ is quite good with the numbers but it does get it wrong sometimes.

--
FFMG
Please remove _NOSPAM in email address for reply.



Sat, 28 Feb 2004 12:21:40 GMT  
 resource.h values
This can become a very bad problem - unless there's something I'm missing. I
have a large, heavily-dialog based application with hundreds if not
thousands of controls. When it comes to adding tooltips, any ID conflicts
cause great pain in the string tables.

What is the best advice for getting in there and manually editing these
things? And how do we ensure that VS gives us unique ID's?

TIA,

Neil B



Mon, 01 Mar 2004 17:22:35 GMT  
 resource.h values
Are you sure it's a problem? I've been creating GUI apps with VC++ for
years without any problems.

If it is a problem, just write a script (Perl? Python?) to go through resource.h

and renumber everything. As long as you update the next-resource IDs at
the bottom and do a total rebuild afterwards you should be all set.

Quote:

> This can become a very bad problem - unless there's something I'm missing. I
> have a large, heavily-dialog based application with hundreds if not
> thousands of controls. When it comes to adding tooltips, any ID conflicts
> cause great pain in the string tables.

> What is the best advice for getting in there and manually editing these
> things? And how do we ensure that VS gives us unique ID's?

> TIA,

> Neil B



Mon, 01 Mar 2004 23:33:43 GMT  
 resource.h values


Fri, 19 Jun 1992 00:00:00 GMT  
 resource.h values
I want to thank you all for helping me with this issue.  

Much appreciated.

Jeff Klopotic



Tue, 02 Mar 2004 08:45:51 GMT  
 resource.h values


Fri, 19 Jun 1992 00:00:00 GMT  
 resource.h values


Quote:
> Are you sure it's a problem? I've been creating GUI apps with VC++ for
> years without any problems.

> If it is a problem, just write a script (Perl? Python?) to go through
resource.h

> and renumber everything. As long as you update the next-resource IDs at
> the bottom and do a total rebuild afterwards you should be all set.

Hi Bruce,

This is in fact what I did yesterday with success. I'm trying to isolate
what it is about my environment - or actions - that causes VC to duplicate
ID's, because it is certainly doing it.

Cheers!

Neil B



Tue, 02 Mar 2004 16:11:55 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. resource.h values

2. resource.h values

3. resource symbol values

4. Q: how to change resource id values?

5. Getting resource values

6. Need Version Resource Values...

7. Value, value, who's got the value?

8. How to find out amount of free resources (gdi resources, handles, system resources)

9. Resetting PropertyGrid value to old value

10. addition long values to long double value ?

11. global value and extern value

12. How can I transform a int value to a char value

 

 
Powered by phpBB® Forum Software