What may cause resource.h to have negative values defined for MFC controls?

Viewed 626

Currently, we have #define IDC_* added to the point that we have reached 32767 (0x7FFF).

Now that we tried to add 32768 (0x8000), all the sudden it became a negative value (#define IDC_TEST_BUTTON -32768 which is also 0x8000). From there on, #define statements are incrementing starting from -32768 (such as -32767, -32766, etc).

Our _APS_NEXT_CONTROL_VALUE is pointing to 32769, as it should be.

I thought maybe this is a bug with Microsoft's use of unsigned short and signed short, so I created a new MFC project and intentionally set the _APS_NEXT_CONTROL_VALUE to 32768 and started adding controls in the designer. However, in this case, #define IDC_TEST_BUTTON 32768 and _APS_NEXT_CONTROL_VALUE became 32769, as expected.

I searched my entire program's resource.h to see if there are any possible duplicate numbers, since that seems to cause #define statements to become negative. But I could not find any.

According to Microsoft's documentation, IDC is allowed up to the value of 0xDFFF, so 0x8000 is well within the allowed ID.

Does anybody have any clue why this is happening?

0 Answers
Related