Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Retrieving lanuage setting

Posted on 2003-03-05
13
Medium Priority
?
370 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 20 hours left to enroll

580 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