Link to home
Start Free TrialLog in
Avatar of LPlate
LPlate

asked on

Up and down of resource file's

I'm am a new comer to VB6, what are the advantage and dis-advantages of using resource file with mulitple string tables ????. i'm currently doing a project which has to be translated into English, Dutch, French, Italian, German and Polish. People have said to use ini files to store the string the read them out, with 1500 different strings to translate won't the slow the application down ?????? Please HELP All EXPERTS ROCK  
Avatar of cquinn
cquinn
Flag of United Kingdom of Great Britain and Northern Ireland image

There is a problem with ini files if you have many strings to hold - Ini files can only be a maximum of 64kb in size - anything that goes over this limit will not be accessible.

Resource files can be any size, but you need to get hold of a Resource compiler - it used to come free with Microsoft help file authoring tools - I don't know if it still does.

Resources can also hold other things - graphics, sounds etc, which ini files cannot.

There was an example project using resource files on the VB install CD's - I think it was called ATM - a simulation of a multilingual cash machine - this will give you the basics
Avatar of kdg2000
kdg2000

It is possible certainly to use INI the file, but the resource file is better.

For this purpose the editor of resources (tab of the menu Add-Ins\Add-In Manager is necessary to connect...). Will be started Add-In Manager. In it is necessary to find VB6 Resouce Editor and to select options 'Loaded\Unloaded' and ' Load on StartUp '. The option ' Add New Resource File ' in the tab 'Project' will appear.

Further about operation with Resource File:

In the help is written, that it is necessary to create the separate tables depending on the language and at change of regional installations the language table automatically varies. But for me it has failed.
And I have made all strings in one table, but with offset, for example: the English strings - ID 1-1000; French - ID 1001-2000 and so on.
And in the program such code:

Public LanguageProgramm As Language_Mode
Public Enum Language_Mode
    None = -1
    English = 0
    French = 1000
End Enum

Me.Label1.Caption = LoadResString (LanguageProgramm + 10)

Where '10' is an offset on the necessary string inside the array of strings with the identical language.
The only disadvantage of using a single resource file with multiple string tables is that it will not work in Win9x or WinCE.  The only Microsoft OS that supports multiple string tables is WinNT, 2k, and XP.  If you want to use a single resource file for all of your strings and you need compatibility with the Win9x or CE environments, do the following.

Decide on resource id ranges such as 1 to 2000 is English, 2001 to 4000 is German, etc.  When your app loads, call the GetLocale function to find where you are and set an offset (i.e. offset would be 2000 for German).  Then when reading from the resource file, you would use LoadResString(EnglishResID + Offset).
Avatar of Richie_Simonetti
I used multiple string tables in win98 whiout any problem. I suggest use it instead of ini files, or use a database if you want.
Hi LPlate,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.
    *** All good answers; tto few points to split.

LPlate, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
Good to me.
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

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