[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

#define value for string table addition

Posted on 2006-05-09
11
Medium Priority
?
1,741 Views
Last Modified: 2013-11-20
Ah hello.

Regarding the string table editor in VS.NET 2003, how can I determine which is the next value that will be used for a new string ?  (i.e. every new string added gets a #define value for it).  I thought the key was the following section of resource.h:

#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        130
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1006
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif

however,

_APS_NEXT_RESOURCE_VALUE only increments when I add a new resource (like dialog or menu)
_APS_NEXT_CONTROL_VALUE only increments when I add a new control, like a button
_APS_NEXT_COMMAND_VALUE only increments when I add a new command, like a menu option handler
_APS_NEXT_SYMED_VALUE is apparently to do with adding new symbols.  

I have read the suggested links (mainly http://msdn2.microsoft.com/en-us/library/6t3612sk(VS.80).aspx) but still don't know how the ID for a new string is defined.

Does anyone here ?

TIA
0
Comment
Question by:mrwad99
  • 6
  • 3
  • 2
11 Comments
 
LVL 45

Assisted Solution

by:AndyAinscow
AndyAinscow earned 240 total points
ID: 16639542
I think the whole matter is complicated by the fact that some resources (eg. toolbar buttons, menu items) can have a string associated with them.

Exactly how the resource editor works to get the next ID to use for a string I honestly do not know.

Is this just a general question for your own edification or do you have a specific requirement?
0
 
LVL 19

Author Comment

by:mrwad99
ID: 16639854
Thanks Andy

>> Is this just a general question for your own edification or do you have a specific requirement?

I really need to know.  The thing is, I have a big project with loads and loads of strings in it, and I am now adding new ones, but found that when I run the program, some parts of the UI have the incorrect strings due to the new string IDs clashing with ones already existing.

This led me to realise that if I do not figure out how to solve this, it could get to the point where I have far too many strings to sort the problem.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16639923
:-(
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16639943
Do you have just one .rc file and one resource.h file ?
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16640113
>>I have a big project with loads and loads of strings in it, and I am now adding new ones,

this problem is occuring due to duplicating resource by copy paste and renaming resource names ?

btw if you refer following tech note general strings having valid range of  1 -> 0x7FFF
 
'TN020: ID Naming and Numbering Conventions'
http://msdn2.microsoft.com/en-US/library/t2zechd4.aspx

you may also refer this possible cause of resource id clash by copy/paste and rename
http://www.kbalertz.com/141345/Duplicating.Resource.Causes.Resource.Collision.aspx

-MAHESH
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16645932
A further question for you - is it mixing strings in dll's and exe's ?
0
 
LVL 19

Author Comment

by:mrwad99
ID: 16656350
Andy: no, these strings are just in the program EXE itself.  It would not be a problem if duplicate string IDs exist in the exe and in separate DLLs anyway, as long as I set the resource handle to be appropriate.

I will close this soon if nothing else happens here.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16656372
exe's and dll's - that is the answer I expected BUT it was better to confirm it.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16656639
This might be of use to you
http://www.codeproject.com/macro/resorg.asp
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 260 total points
ID: 16657018
If you have multiple resource files in a projects it allows you to give the same for different resources and also generates the same id for different resources.

This tech note might be also useful if you have multiple resource / header files :

TN035: Using Multiple Resource Files and Header Files with Visual C++
http://msdn2.microsoft.com/en-us/library/6t3612sk.aspx

AFAIK there is nothing 'inbuilt' to fix already duplicated ID's other than manually editing the resource files or any third party plugin. Having chosen a unique set of ranges for each file simply renumber the existing stuff from the top down. There is no real significance in the numbers, except the command IDs should be above 32K. You could even construct a small program to do this for you.

-MAHESH

0
 
LVL 19

Author Comment

by:mrwad99
ID: 16673892
Thanks both.  Since the answer was not found, I will still give the points for effort.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question