Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 738583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:51:11+00:00 2026-05-14T07:51:11+00:00

I have a VB6’s Application that is in production environment right now, this application

  • 0

I have a VB6’s Application that is in production environment right now, this application is reading the pc’s Regional Settings; but now, I need to set another Regional Settings for the application without change the pc’s settings.

How can I set the new Regional Settings globally with the lowest impact? Is there any configuration method (or something like that) for do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:51:11+00:00Added an answer on May 14, 2026 at 7:51 am

    From http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_21841979.html

    Option Explicit
    
    Public Enum DateOrderEnum
       doDefault 'Your locale setting
       doMDY     'Month-Day-Year (U.S.)
       doDMY     'Day-Month-Year (EU, S.A.)
       doYMD     'Year-Month-Day (Japan)
    End Enum
    
    Public Const LOCALE_SSHORTDATE As Long = &H1F
    Public Const LOCALE_STHOUSAND As Long = &HF
    Public Const LOCALE_SDECIMAL  As Long = &HE
    
    Public Declare Function GetUserDefaultLCID Lib "kernel32" () As Long
    Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
    Public Declare Function GetLocaleInfoA Lib "kernel32" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
    
    Public Function GetThousandsSep() As String
       GetThousandsSep = pfGLI(GetUserDefaultLCID(), LOCALE_STHOUSAND)
    End Function
    
    Public Function GetDecimalSep() As String
       GetDecimalSep = pfGLI(GetUserDefaultLCID(), LOCALE_SDECIMAL)
    End Function
    
    'Purpose: Assume a date string with English separator "1/4/2006"
    'Returns: Correct Date Variable
    Public Function ResolveDate(ByVal sDate As String) As Date
       Dim sArray() As String
       If InStr(sDate, "/") Then 'Potentially a date string
          sArray = Split(sDate, "/")
          Debug.Print "GetUserDefaultLCID", GetUserDefaultLCID
          Debug.Print "GetSystemDefaultLCID", GetSystemDefaultLCID
          If UBound(sArray) = 2 Then 'We have 3 parts
             Select Case ShortDateOrder2
                Case doMDY '
                   ResolveDate = DateSerial(sArray(2), sArray(0), sArray(1))
                Case doDMY
                   ResolveDate = DateSerial(sArray(2), sArray(1), sArray(0))
                Case doYMD
                   ResolveDate = DateSerial(sArray(0), sArray(1), sArray(2))
             End Select
          End If
       End If
    End Function
    
    'Purpose: Assume a number string with English separators "123,456.78"
    'Returns: Correct Double Variable
    Public Function ResolveNumber(ByVal sNum As String) As Double
       Dim sTS As String
       Dim sDS As String
       sTS = GetThousandsSep
       sDS = GetDecimalSep
    
       If (sTS = ",") And (sDS = ".") Then 'English
          'format is OK
       Else
          Dim i As Long
          Dim sMid As String
          For i = 1 To Len(sNum)
             Select Case Mid(sNum, i, 1)
                Case ","
                   Mid(sNum, i, 1) = sTS
                Case "."
                   Mid(sNum, i, 1) = sDS
             End Select
          Next
       End If
    
       ResolveNumber = CDbl(sNum)
    
    End Function
    
    Public Function ShortDateOrder2() As DateOrderEnum
       'Get ShortDateOrder the hard way
       Dim sShort           As String
       Dim qOn              As Boolean
       Dim i                As Integer
       Dim sChar            As String
    
       On Error Resume Next
    
       'Get the Short Date format
       sShort = pfGLI(GetUserDefaultLCID(), LOCALE_SSHORTDATE)
    
       For i = 1 To Len(sShort)
          sChar = Mid(sShort, i, 1)
          'Ignore items in single quotes (if any)
          If sChar = "'" Then
             qOn = Not qOn
          Else
             If Not qOn Then
                Select Case sChar
                   Case "d"
                      ShortDateOrder2 = doDMY
                      Exit Function
                   Case "m"
                      ShortDateOrder2 = doMDY
                      Exit Function
                   Case "y"
                      ShortDateOrder2 = doYMD
                      Exit Function
                End Select
             End If
          End If
       Next
    End Function
    
    Private Function pfGLI(ByVal m_LocaleLCID As Long, ByVal reqInfo As Long) As String
       Dim Buffer As String * 255
       GetLocaleInfoA m_LocaleLCID, reqInfo, Buffer, 255
       pfGLI = StripNull(Buffer)
    End Function
    
    Public Function StripNull(ByVal StrIn As String) As String
       Dim nul              As Long
       nul = InStr(StrIn, vbNullChar)
       Select Case nul
          Case Is > 1
             StripNull = Left$(StrIn, nul - 1)
          Case 1
             StripNull = ""
          Case 0
             StripNull = Trim$(StrIn)
       End Select
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VB6 application that needs to update it's self. For this purpose,
We have a problem affecting the production environment only. We have a VB6/ASP website
I have a VB6 application that uses a COM DLL. The DLL is written
We have an enterprise VB6 application, this application require access to many shared resources.
I have inherited a frankenstein VB6 Converted to VB.NET winform application. This application has
I have VB6 application , I want to put some good error handling finction
I have a VB6 program that someone recently helped me convert to VB.NET In
I have a VB6 dll that is trying to create a COM object using
I have a VB6 COM component which I need to call from my .Net
We have inherited VB6 dll which we need to make changes to. We have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.