Change resource dll list while runtime

B

Bj?rn

HY,

my problem is the following:

I want to give a very big application the ability, to change the
language at runtime. It's written in Visual C++ 6.0. All language
depending strings and so on, are already stored in different
resource-dll's. The way, I understand it, there is a list of
resources, which the application goes through, searching for strings.
For example my string is in stringa.dll in english. But I want to have
the application in French, which is all stored in stringb.dll.

Can I somehow replace the pointer (?) in the resource-dll-list with
another one? It's very circuitous to change the main resource pointer
(AfxSetResourceHandle()) all the time...

Thank you very much,

Bjoern
 
A

Andre Kostur

(e-mail address removed) (Bj?rn) wrote in @posting.google.com:
HY,

my problem is the following:

I want to give a very big application the ability, to change the
language at runtime. It's written in Visual C++ 6.0. All language
depending strings and so on, are already stored in different
resource-dll's. The way, I understand it, there is a list of

[snip]

And you go spinning off into the realm of platform-specific stuff.... which
is off-topic for comp.lang.c++. In clc++ the topic is Standard C++, which
has no concept of DLLs.... Please try over in the Microsoft programming
groups....
 
J

JKop

Bj?rn posted:
HY,

my problem is the following:

I want to give a very big application the ability, to change the
language at runtime. It's written in Visual C++ 6.0. All language
depending strings and so on, are already stored in different
resource-dll's. The way, I understand it, there is a list of
resources, which the application goes through, searching for strings.
For example my string is in stringa.dll in english. But I want to have
the application in French, which is all stored in stringb.dll.

Can I somehow replace the pointer (?) in the resource-dll-list with
another one? It's very circuitous to change the main resource pointer
(AfxSetResourceHandle()) all the time...

Thank you very much,

Bjoern


I've done this before.

Here was my strategy:

I defined a struct called "Language", and I gave it a member variable for
every string in the program:

struct Language
{
const char* open;
const char* close;
const char* exit;
};


Then I would have a global object of this structure:


Language current_language;


And throughout the entire program, this object would be used.


I'd have a function to change the language:


void ChangeCurrentLanguageToIrish()
{
current_language.open = "Oscaill";
current_language.close = "Dún";
current_language.exit = "Fág";
}


But ofcourse, you could get the strings from anywhere, like in Win32, you
could load them from the resource file within the executable.


-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top