?
Solved

Retrieving lanuage setting

Posted on 2003-03-05
13
Medium Priority
?
368 Views
Last Modified: 2007-12-19
I am creating a multilanguage VB application. When I change the language and step through the application, the new language is recognized and the form is loaded correctly.  At runtime the same exact code displays  the form in English ALWAYS.  I am trying to use the SetThreadLocale api. If anyone has any suggestion please let me know
0
Comment
Question by:rjohns621
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
13 Comments
 
LVL 6

Expert Comment

by:Taconvino
ID: 8073731
Just a thought: SetThreadLocale only works on NT.

TCV
0
 

Author Comment

by:rjohns621
ID: 8073935
I am using Windows XP
0
 

Author Comment

by:rjohns621
ID: 8073948
I am using Windows XP
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rjohns621
ID: 8073954
I am using Windows XP
0
 
LVL 6

Accepted Solution

by:
Taconvino earned 1500 total points
ID: 8074042
OK. This is from Microsoft:
"Windows 2000/XP: Do not use SetThreadLocale to select a UI language. To select the proper resource that is defined with a LANGUAGE statement, use FindResourceEx."

Ref:: http://msdn.microsoft.com/library/en-us/intl/nls_52lh.asp

TCV
0
 

Expert Comment

by:bziherl
ID: 8075890
1. Download this module:

http://www.trigeminal.com/code/LcidCp.bas

2. Create the following sub to check either your system language is english, spanish, german... (see the module for other constants):

Public Sub CheckLanguage()

    ' Function GetPLId returns language ID
    Select Case GetPLId
        Case LANG_ENGLISH ' English
            MsgBox "Your language is English."
        Case LANG_SPANISH ' Spanish
            MsgBox "Your language is Spanish."
        Case LANG_GERMAN ' German
            MsgBox "Your language is German."
        Case LANG_ITALIAN ' Italian
            MsgBox "Your language is Italian."
        Case LANG_SLOVENIAN ' Slovenian
            MsgBox "Your language is Slovenian."
        ' Others...
    End Select

End Sub


Hope this will help you,
Blaz
0
 

Author Comment

by:rjohns621
ID: 8079980
Blaz,
that was a very interesting module.  However, I am trying to change the Lanuguage or get VB to recognize the language at runtime.  How do you get VB to recognize the language setting?
0
 
LVL 6

Expert Comment

by:Taconvino
ID: 8080080
You can always use GetLocaleInfo.

TCV
0
 

Author Comment

by:rjohns621
ID: 8080555
I have not problem geeting the LCID..  The problem is setting it.  Nothing seesm to work as far as setting it.  
0
 

Author Comment

by:rjohns621
ID: 8080697
I have not problem geeting the LCID..  The problem is setting it.  Nothing seesm to work as far as setting it.  
0
 
LVL 6

Expert Comment

by:Taconvino
ID: 8080725
That's a problem, because SetLocaleInfo will change the LCID for the current user (affecting all applications).
0
 

Author Comment

by:rjohns621
ID: 8081998
It does not matter if it affects all applications.  I will try the SetLocalInfo.  What is really tricky is that the VB app detects the lauguage in design mode but at runtime, the application will only come up English
0
 

Author Comment

by:rjohns621
ID: 8081999
It does not matter if it affects all applications.  I will try the SetLocalInfo.  What is really tricky is that the VB app detects the lauguage in design mode but at runtime, the application will only come up English
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 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