Solved

COleCurrency::ParseCurrency()

Posted on 1997-08-26
1
268 Views
Last Modified: 2013-11-20
Why does COleCurrency::ParseCurrency fail when I have the Swedish Regional settings ?
It seems to be a problem when I have a dot as thousand sign and a comma as a decimal sign at the same time.
Regards, torbjorn.berglund@reterm.se
0
Comment
Question by:tberglund
1 Comment
 
LVL 1

Accepted Solution

by:
kargo earned 500 total points
ID: 1304939
The COleCurrency::ParseCurrency function uses a function in OleAuth32.dll that is supposed to convert OLE types from something to something else.  In this case the conversion if from OLESTR to CURRENCY.  There is a bug in the VarCyFromStr(() function which is used in that conversion.  You may have noticed that the default "Digit Grouping Symbol" in the Control Panel setting if either " " or ",".   I guess that you manually added the "." to get the result you mention.  The value is ignored in reality so you can only use a " " since the "," is used as the "Decimal Symbol".  The solution I came up with is to parse user entered text and place " " where ever the "Digit Grouping Symbol" appears before the conversion.  When going to the display I find " " and replace them with the "Digit Grouping Symbol".
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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