🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #815

Re: Change locale settings.

#815
From: rogo
Date: Fri, 30 Nov 2007 08:01
41 lines
2218 bytes
It is returning a value >0 so i am assuming it supposed to be working, but i 
have a euro friend that says it doesn't..

here's the actual code i am using.
SetToDecimal check is done on opening the app.
usingeuro determines whether the SetToComma function is called on closing 
app.

void __fastcall TMainForm::SetToDecimal(void)
{

   char buff [100];
    GetLocaleInfo(MAKELCID(MAKELANGID(LANG_NEUTRAL, 
SUBLANG_NEUTRAL),SORT_DEFAULT),
                     LOCALE_SDECIMAL,buff,100);
   if(StrPas(buff) == ",")
          {
       if(!SetLocaleInfo(MAKELCID(MAKELANGID(LANG_NEUTRAL, 
SUBLANG_NEUTRAL),SORT_DEFAULT),
                      LOCALE_SDECIMAL,"."))
       ShowMessage("Unable to set correct decimal settings.");
       SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
       usingeuro = true;
          }
}

void __fastcall TMainForm::SetToComma(void)
{
    char buff [100];
    GetLocaleInfo(MAKELCID(MAKELANGID(LANG_NEUTRAL, 
SUBLANG_NEUTRAL),SORT_DEFAULT),
                     LOCALE_SDECIMAL,buff,100);
   if(StrPas(buff) == ".")
          {
       SetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_SDECIMAL,",");
       usingeuro = false;
          }
     SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
}

thanks 
Technical Details
Message-ID: <474fc345@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <474f4d15$1@newsgroups.borland.com> <e6muk3hrea2645655kttdhk136q7klkacb@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ba27b370fdf528b1
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "rogo" <gui@tesco.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <474f4d15$1@newsgroups.borland.com> <e6muk3hrea2645655kttdhk136q7klkacb@4ax.com>
Subject: Re: Change locale settings.
Date: Fri, 30 Nov 2007 08:01:12 -0000
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 82.21.181.76
Message-ID: <474fc345@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1196409669 82.21.181.76 (30 Nov 2007 00:01:09 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail