WIN 2k API vs WIN 98/WIN NT API - Help needed 
Author Message
 WIN 2k API vs WIN 98/WIN NT API - Help needed

Hi there

Im Using GetLocaleInfo and SetLocaleInfo to change the regional
settings in my program. I need to use dot to decimal places and coma
to group.... but the default windows to new profiles are exacly the
opposit.

The thing is that in win 98/nt the GetLocalInfo and SetLocalInfo works
100%... with 2k.... thats another story.

Does any one out there has code to change the regional settings
(Number and Curency settings) that work with Win2000?

Thanks in advance!

JoCa



Fri, 26 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
I think you need to find a way to do the work yourself without mucking with
people's regional settings. This is an app to uninstall if its changing my
preferences just because it is too lazy to let me keep my own.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/

?

Quote:
> Hi there

> Im Using GetLocaleInfo and SetLocaleInfo to change the regional
> settings in my program. I need to use dot to decimal places and coma
> to group.... but the default windows to new profiles are exacly the
> opposit.

> The thing is that in win 98/nt the GetLocalInfo and SetLocalInfo works
> 100%... with 2k.... thats another story.

> Does any one out there has code to change the regional settings
> (Number and Curency settings) that work with Win2000?

> Thanks in advance!

> JoCa



Fri, 26 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed

Quote:
>I think you need to find a way to do the work yourself without mucking with
>people's regional settings. This is an app to uninstall if its changing my
>preferences just because it is too lazy to let me keep my own.

Nice comment.

The problem is that Visual Basic dont undestand that some users use
coma and some users use dot to decimal places. In your numeric
keyboard you have a dot, and not a coma. So Users use mutch more the
dot as a numeric decimal delimitor than the coma. Is pretty logic
right?

The BIG problem is that when you usa a VAL statment in Visual Basic,
if you use a DOT when a coma is defined in the regional settings, then
the resulting number is for example 1055 instead of 1.055

Now... I know that I could do a function and all... to check that out
but i have literally thousands of text box.... not a very nice idea.
Besides, the GetLocaleInfo does not return the data I was hopping for
in wind2000 as in win98 and NT

Either whay... maybe Im doing something worng.... any one knows how
can I tell vb to use allwais a DOT as a decimal separator instead of
what is defined in the regional settings? If not, the only solution
that I have, is to change the regional settings on the way in, and
restore them in the way out...

If you have a better solution, please tell us... because this is not a
1 guy problem for sure.

Thanks in advance

JoCa



Sat, 27 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
There is no way to make VB *not* use regional settings. But the issue of you
having a number that is stored as a string and thus needing to convert it
SHOULD be a non-issue. You simply need to do the following:

1) store your numbers *AS* numbers
2) display them using the user's regional settings
3) assume that users will USE their regional settings for data they type in

If you do this, then you should never need to care about the user's
settings; you will certainly never need to modify them.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/

?

Quote:
> >I think you need to find a way to do the work yourself without mucking
with
> >people's regional settings. This is an app to uninstall if its changing
my
> >preferences just because it is too lazy to let me keep my own.

> Nice comment.

> The problem is that Visual Basic dont undestand that some users use
> coma and some users use dot to decimal places. In your numeric
> keyboard you have a dot, and not a coma. So Users use mutch more the
> dot as a numeric decimal delimitor than the coma. Is pretty logic
> right?

> The BIG problem is that when you usa a VAL statment in Visual Basic,
> if you use a DOT when a coma is defined in the regional settings, then
> the resulting number is for example 1055 instead of 1.055

> Now... I know that I could do a function and all... to check that out
> but i have literally thousands of text box.... not a very nice idea.
> Besides, the GetLocaleInfo does not return the data I was hopping for
> in wind2000 as in win98 and NT

> Either whay... maybe Im doing something worng.... any one knows how
> can I tell vb to use allwais a DOT as a decimal separator instead of
> what is defined in the regional settings? If not, the only solution
> that I have, is to change the regional settings on the way in, and
> restore them in the way out...

> If you have a better solution, please tell us... because this is not a
> 1 guy problem for sure.

> Thanks in advance

> JoCa



Sat, 27 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
I dont use strings.... I use textbox to retrieve user input. By your
comment you must thing Im a newbie for sure.... guess what? NOT!

The thing is, and I explain once more, is that the users enters 129.88
and not 129,88. Why is that? Because the decimal place used is the DOT
and not the COMA! The explanation is simple... in European keyboards,
the decimal separator in the numeric keyboard is the DOT.

If I have defined in regional settings thet the COMA is THE decimal
separator and if the user uses the DOT as a decimal delimiter, the
129.88 turns to 12988!!

I hope I was clear by now...

The problem is that when you have Portuguese regional settings,
Windows assumes COMA instead of DOT. The user is not very smart to go
and change it, so I need to change it my self. Its not very convinient
do that by Phone every time this happens.

I still with the same problem.

Thanks in Advance
JoCa



Sat, 27 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
Hello!

If you want to enter numbers only in current locale format, and reject
others, use CDbl, CCur, CLng functions instead Val.

You may test decimal separator by this function:

Public Function DecimalSeparator() As String
DecimalSeparator = Mid$(CStr(1.1), 2, 1)
End Function

You may change on-the-fly any entered by user dot to locale decimal
separator in TextBox Change event.

If you vant to use all numbers only in US format, you may use
VariantChangeTypeEx API function to convert variable types. You may pass any
Locale ID to this function. The sample you can see in the file Setup1.bas
from VB6 distributive.

Sergey Merzlikin


Quote:
> >I think you need to find a way to do the work yourself without mucking
with
> >people's regional settings. This is an app to uninstall if its changing
my
> >preferences just because it is too lazy to let me keep my own.

> Nice comment.

> The problem is that Visual Basic dont undestand that some users use
> coma and some users use dot to decimal places. In your numeric
> keyboard you have a dot, and not a coma. So Users use mutch more the
> dot as a numeric decimal delimitor than the coma. Is pretty logic
> right?

> The BIG problem is that when you usa a VAL statment in Visual Basic,
> if you use a DOT when a coma is defined in the regional settings, then
> the resulting number is for example 1055 instead of 1.055

> Now... I know that I could do a function and all... to check that out
> but i have literally thousands of text box.... not a very nice idea.
> Besides, the GetLocaleInfo does not return the data I was hopping for
> in wind2000 as in win98 and NT

> Either whay... maybe Im doing something worng.... any one knows how
> can I tell vb to use allwais a DOT as a decimal separator instead of
> what is defined in the regional settings? If not, the only solution
> that I have, is to change the regional settings on the way in, and
> restore them in the way out...

> If you have a better solution, please tell us... because this is not a
> 1 guy problem for sure.

> Thanks in advance

> JoCa



Sat, 27 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
THIS IS USER ERROR THEN.

If they are not using their own regional settings, then they have bigger
problems than just your application. You should be able to rely on them
going with their own selections. Totally their fault.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/

?

Quote:
> I dont use strings.... I use textbox to retrieve user input. By your
> comment you must thing Im a newbie for sure.... guess what? NOT!

> The thing is, and I explain once more, is that the users enters 129.88
> and not 129,88. Why is that? Because the decimal place used is the DOT
> and not the COMA! The explanation is simple... in European keyboards,
> the decimal separator in the numeric keyboard is the DOT.

> If I have defined in regional settings thet the COMA is THE decimal
> separator and if the user uses the DOT as a decimal delimiter, the
> 129.88 turns to 12988!!

> I hope I was clear by now...

> The problem is that when you have Portuguese regional settings,
> Windows assumes COMA instead of DOT. The user is not very smart to go
> and change it, so I need to change it my self. Its not very convinient
> do that by Phone every time this happens.

> I still with the same problem.

> Thanks in Advance
> JoCa



Sat, 27 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
I had the same problem and used the localeid to figure out what
international seperator was configured and coded accordingly.
But part of my application configuration was to allow the user to change the
separator, currency symbol, and metric or imperial setup.
This allowed my app even when set on a strange regional setting to allow the
app only defaults to be changed.
I also printed out a detailed system information sheet so I could diagnose
their problem a sub set below
____________________________________________________________________
    Measurment / Weight Program Info
              Weight System Set:            Metric
Measurement S

____________________________________________________________________
    Global variable Values
              Registry Locale:              English (Australian)
Currency Symb

____________________________________________________________________
    System Locale Info
              Country code:                 61                       Country
name:
              International symbol:         AUD
Language:
              Monentary digits:             2
Currency Symb
              Decimal seperator:            .                        Date
seperato
              Abbreviation for Language:    ena                      System
Metric
              Negative currency mode:       1                        Time
format:
              Locale Thread ID:              3081                    System
Defaul

____________________________________________________________________
    Operating System Info
              Platform:                     Windows 98SE
Version:
              Build:                        2222                     Service
Pack:

____________________________________________________________________
    System Time Zone Information
              Configured to Daylight Savings Time...                 Time
zone nam
              Universal time bias:   -10 hrs.                        ST
Zone:
              Standard date:          26/03/00 2:00:00 AM
Standard bias
              Daylight start date:   29/10/00 2:00:00 AM
Daylight bias


Quote:
> I dont use strings.... I use textbox to retrieve user input. By your
> comment you must thing Im a newbie for sure.... guess what? NOT!

> The thing is, and I explain once more, is that the users enters 129.88
> and not 129,88. Why is that? Because the decimal place used is the DOT
> and not the COMA! The explanation is simple... in European keyboards,
> the decimal separator in the numeric keyboard is the DOT.

> If I have defined in regional settings thet the COMA is THE decimal
> separator and if the user uses the DOT as a decimal delimiter, the
> 129.88 turns to 12988!!

> I hope I was clear by now...

> The problem is that when you have Portuguese regional settings,
> Windows assumes COMA instead of DOT. The user is not very smart to go
> and change it, so I need to change it my self. Its not very convinient
> do that by Phone every time this happens.

> I still with the same problem.

> Thanks in Advance
> JoCa



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed

Quote:
>THIS IS USER ERROR THEN.

>If they are not using their own regional settings, then they have bigger
>problems than just your application. You should be able to rely on them
>going with their own selections. Totally their fault.

Go tell them that.... dont you ever heard? The custumer is allwais
right.

Go figure....

JoCa



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
Thanks

thats a good solution.... but ill need to change the wole
application.... many forms, many textbox.... gishhh... not a easy
solution.

JoCa



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
Thanks for the tip

JoCa



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
Actually, if you are a consultant, than for some reason the customer cannot
do ity themselves (usually, they do not know how). The customer is in fact
WRONG and is relying on your expertise. It is entirely proper and actually
requires that you help them understand how things are.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/

?

Quote:
> >THIS IS USER ERROR THEN.

> >If they are not using their own regional settings, then they have bigger
> >problems than just your application. You should be able to rely on them
> >going with their own selections. Totally their fault.

> Go tell them that.... dont you ever heard? The custumer is allwais
> right.

> Go figure....

> JoCa



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
Thats true... but there is no pratical application.

The users keep on calling me saying that the report shows a 500%
increase in profit.... and even if I try to explain that the regional
settings are incorrect... what he wants to know is when Ill give him
the correct report. Database, regional settings and stuff like that
its an technician problem. He bough the computer, he wants to press a
key and see results. And of course, play a game once or twice a
day.... thats the reallity of custummer satisfaction arround here.

Quote:
>Actually, if you are a consultant, than for some reason the customer cannot
>do ity themselves (usually, they do not know how). The customer is in fact
>WRONG and is relying on your expertise. It is entirely proper and actually
>requires that you help them understand how things are.



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed
In that case, you are on your own implementing the actual work to do the
same thing that the OS and VB and oleaut would be doing for you otherwise.
Ick (understatement).

What country are these people from that their computer would be set to one
thing but they would want to use another?

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
54-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/

?

Quote:
> Thats true... but there is no pratical application.

> The users keep on calling me saying that the report shows a 500%
> increase in profit.... and even if I try to explain that the regional
> settings are incorrect... what he wants to know is when Ill give him
> the correct report. Database, regional settings and stuff like that
> its an technician problem. He bough the computer, he wants to press a
> key and see results. And of course, play a game once or twice a
> day.... thats the reallity of custummer satisfaction arround here.

> >Actually, if you are a consultant, than for some reason the customer
cannot
> >do ity themselves (usually, they do not know how). The customer is in
fact
> >WRONG and is relying on your expertise. It is entirely proper and
actually
> >requires that you help them understand how things are.



Sun, 28 Jul 2002 03:00:00 GMT  
 WIN 2k API vs WIN 98/WIN NT API - Help needed


Quote:
> Hi there

> Im Using GetLocaleInfo and SetLocaleInfo to change the regional
> settings in my program. I need to use dot to decimal places and coma
> to group.... but the default windows to new profiles are exacly the
> opposit.

> The thing is that in win 98/nt the GetLocalInfo and SetLocalInfo works
> 100%... with 2k.... thats another story.

> Does any one out there has code to change the regional settings
> (Number and Curency settings) that work with Win2000?

> Thanks in advance!

> JoCa

Joca,

Try this:
Set the forms KeyPreview Property to True and add this code to your form,
this will only alter the "." pressed on the numeric keypad, not the
normal ".":
Option Explicit
Private bDecimalPressed As Boolean

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    bDecimalPressed = (KeyCode = vbKeyDecimal)
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    If bDecimalPressed Then
        KeyAscii = Asc(",")
        bDecimalPressed = False
    End If
End Sub

Hugo.
--

For e-mail remove X's.



Mon, 29 Jul 2002 03:00:00 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

2. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

3. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

4. VB 5 on win 98 vs win nt

5. Win 98,Win XP and API

6. Win API Call not working in vb.net app distributed to WIn 98

7. HELP: Wininet.dll problem (Win NT4 vs Win 2k)

8. Userform Controls change their size between Win 98 and Win NT

9. GetOpenFileName:Win 98 vs. NT

10. Win '98 API vs. Win '95 API

11. Win '98 API vs. Win '95 API

12. Win '98 API vs. Win '95 API

 

 
Powered by phpBB® Forum Software