Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can literals be replaced with constants in the resource file ?

Status
Not open for further replies.

Ziggurat

Programmer
Jun 6, 2001
81
GB
Dear All

I am a newby at C++ and so I would like some information (If anyone knows).

I have a resource file ***.rc which contains all the definitions for the buttons, menus, etc.

When I look at the resource file all of the settings are literal strings
eg
MENUITEM "Display",ID_DISPLAY

My question is :-

Can I change the literal string "Display" into a constant eg MY_DISPLAY and then compile the program ?

If the answer is yes, then my next question is where should I store the declaration of the constant MY_DISPLAY = "Display"

Thank you for your time.


#
###
#####
#######
Ziggurat
 
My intial response would be no. The only way I could see it happening is if you modify the "resource includes" and include your own file that has #defines in it for your constants. I have never done this, and with some work I did with resource files, it looks like they are more interpreted then compiled (just a guess).

What is it you are trying to accomplish? Maybe that could provide more insight on how to do what you would like.

Matt
 
Thank you Zyrenthian for your timely response.

The problem that I have is that we want to translate all the information in the *.RC file into another language. I thought that if I could define the literals into a constant and then translate that constant into the specific language that we wanted then it would an easy way to make multilingual programs, because all you would need to do is modify the contants file.

Any help in this area would be greatly appreciated.


#
###
#####
#######
Ziggurat
 
you can use #define difective in resource file also

Ion Filipski
1c.bmp
 
Thank you all for your advice.

It was of great help.

#
###
#####
#######
Ziggurat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top