Link to home
Start Free TrialLog in
Avatar of cclim
cclim

asked on

Resource Editor in VB

How to use multiple string table in resource editor (add-on tool). I had able to use single string table but not multiple string table. The purpose to use multiple string table is to create multilingual purpose. Please submit the source code together for me.
Avatar of abhinavm
abhinavm

i have no idea how to add multiple string table in resource file. i am not sure that you can do it.
  for having multi lingual strings you can do one thing. store strings for different language in same table, but having perticular base address. like for english start storing strings from 1000 onwards for German store 2000 onwards etc.
  and in your code use loadrestring( languageBase+ offset) where languageBase you can have has compiler define constant which you can set according to language, and offset is the string number.

Avatar of cclim

ASKER

Sorry to reject the proposal. The reason is I had know this ideas.Based on "resources add-on" help file, multiple string table is able to be created and we don;t need to use the method as you method as above( language +offset) and during run-time, VB able to obtain the LCID from your system and go to the appropriate column in the multiple string table to display the appropriate language. Beside that, the method you metion had some disadvantage . E.g. when one type of language is more 1000 in future then how your program need to do? Do you change the code?
 On the other hand, based on my knowledge, this problem can be solve using multiple string table in resource editor. Therefore, more description of multiple string table is in the help file. If anybody can solve it, please do let me know and attach the source code as well. Thanks.
Are you using version 5 or version 6?
In case that you are using version 5. Which resource editor are you talking about?
Other resource editor like Microsoft DevStudio can create multiple string tables.
What I always do is one resource dll per language.
I load the correct language resource dll with loadlibrary and load the resources with LoadResource.

Avatar of cclim

ASKER

Actually, i am using Visual Basic 5.0 Prof. Ed. and I download the reosurce editor add-on from the Visual Studio home page in Microsft site. Anyway, I understand what you (MirkWood) saying but how about i just want to put all type of language in one dll instead of one language per dll?
 Thanks for your answer.
For first language start with 0 ID and the second language will start in 1000 and so on. The program will have an ID for the string you want from the resource file and language Prefix number(0,1000,...) and like that you can creat multiple language resource file.

hope this helps.
It seems to work for me.
I created two string tables. (just goto Edit string table and choose the second button. Insert new string table)
One of the string tables was English and the other one was Dutch. When I changed the locale Id to Dutch it used the dutch resources in stead of the english ones. So it seems to work.

ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cclim

ASKER

Mirkwood, can you please attach the source code written in VB to me My email address:cclim39@hotmail.com. The reason is, although i had change my system locale id to another language instead of english (e.g France) the france language that store in my multiple string table will not retrieve but VB only retrieve the english version for me. Why?
Avatar of cclim

ASKER

For Mirkwood, I still can't use the other resources although my system language had change from English to other languages such as france. By the way, how do i change the locale ID? I change it in the regional setting in control panel, is it the right place to change it? Please guide me through... Thanks Mirkwood.
Avatar of cclim

ASKER

Where should i change the locale id? Please guide me through. If possible, please send me your source code as well.  The reason is i had change locale id but the language still can't change to Dutch. Thanks.