Click here to Skip to main content
15,895,880 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: Adding Connection Points support Pin
Ju@ncho7-Nov-07 6:08
Ju@ncho7-Nov-07 6:08 
QuestionCOM interfaces with ATL Pin
DanyCode17-Oct-07 9:38
DanyCode17-Oct-07 9:38 
AnswerRe: COM interfaces with ATL Pin
Ju@ncho22-Oct-07 8:28
Ju@ncho22-Oct-07 8:28 
QuestionAdding Images to the subitems in ListView Pin
D.Srihari16-Oct-07 1:36
D.Srihari16-Oct-07 1:36 
AnswerRe: Adding Images to the subitems in ListView Pin
Stuart Dootson16-Oct-07 2:09
professionalStuart Dootson16-Oct-07 2:09 
AnswerRe: Adding Images to the subitems in ListView Pin
Michael Dunn16-Oct-07 7:37
sitebuilderMichael Dunn16-Oct-07 7:37 
Questionconvert the string into german currency Pin
dews turner14-Oct-07 20:41
dews turner14-Oct-07 20:41 
AnswerRe: convert the string into german currency Pin
Stuart Dootson15-Oct-07 0:55
professionalStuart Dootson15-Oct-07 0:55 
If you're ignoring any currency symbols, just imbue input and output streams with appropriate locales:

   std::string in("17,456.43");

   std::istringstream in_us(in);
</code><code></code><code>   in_us.imbue(</code><code>std::locale("English_USA")</code><code>);

   double value;
   in_us >> value;

   std::ostringstream out_de;
   out_de.imbue(</code><code>std::locale("German_germany")</code><code>);
   out_de << std::fixed << std::setprecision(2) << value;

   std::string out = out_de.str(); // Should be "17.456,43"

If you need to read and write currency symbols (by which I mean 'USD' for dollars, 'EUR' for Euros), then you need to use the money_get and money_put facets:

<code>   std::string in("USD17,456.43");
   std::istringstream in_us(in);
   in_us.imbue(std::locale("English_USA"));


</code><code>   long double value;
</code><code>   std::ios_base::iostate state;

   std::use_facet<std::money_get<char> >(std::locale("English_USA")).get(std::istreambuf_iterator<char>(in_us), std::istreambuf_iterator<char>(), true, in_us, state, value);

   std::ostringstream out_de;
   out_de.imbue(std::locale("German_germany"));
   out_de.flags(out_de.flags()|std::ios_base::showbase);

   std::use_facet<std::money_put<char> >(std::locale("German_germany")).put(std::ostreambuf_iterator<char>(out_de), true, out_de, out_de.fill(), value);

   std::string out = out_de.str();</code><code> // Should be "EUR17.456,43"</code> 




QuestionSTL map constructor -- 3rd and 4th argument... Pin
devvvy13-Oct-07 17:02
devvvy13-Oct-07 17:02 
AnswerRe: STL map constructor -- 3rd and 4th argument... Pin
Stephen Hewitt14-Oct-07 15:59
Stephen Hewitt14-Oct-07 15:59 
AnswerRe: STL map constructor -- 3rd and 4th argument... Pin
Stuart Dootson14-Oct-07 20:53
professionalStuart Dootson14-Oct-07 20:53 
QuestionOwner draw combobox Pin
s196675m13-Oct-07 13:56
s196675m13-Oct-07 13:56 
QuestionDrag drop in MMC Pin
Thanks for all the fish10-Oct-07 20:30
Thanks for all the fish10-Oct-07 20:30 
QuestionThe file "atlbase.h" dosent exist in VS 2005 - What I need to do? Pin
yytg8-Oct-07 9:04
yytg8-Oct-07 9:04 
AnswerRe: The file "atlbase.h" dosent exist in VS 2005 - What I need to do? Pin
Stuart Dootson9-Oct-07 22:58
professionalStuart Dootson9-Oct-07 22:58 
GeneralRe: The file "atlbase.h" dosent exist in VS 2005 - What I need to do? Pin
yytg9-Oct-07 23:22
yytg9-Oct-07 23:22 
GeneralRe: The file "atlbase.h" dosent exist in VS 2005 - What I need to do? Pin
Stuart Dootson10-Oct-07 21:16
professionalStuart Dootson10-Oct-07 21:16 
GeneralRe: The file "atlbase.h" dosent exist in VS 2005 - What I need to do? Pin
yytg11-Oct-07 3:45
yytg11-Oct-07 3:45 
QuestionProblem with setting of value in ATL Property Page Pin
akizelokro7-Oct-07 20:38
akizelokro7-Oct-07 20:38 
QuestionProblem in passing a VARIANT to IXMLDOMNodePtr Pin
Rocky#7-Oct-07 20:27
Rocky#7-Oct-07 20:27 
AnswerRe: Problem in passing a VARIANT to IXMLDOMNodePtr Pin
Michael Dunn7-Oct-07 21:18
sitebuilderMichael Dunn7-Oct-07 21:18 
GeneralRe: Problem in passing a VARIANT to IXMLDOMNodePtr Pin
Rocky#7-Oct-07 21:31
Rocky#7-Oct-07 21:31 
AnswerRe: Problem in passing a VARIANT to IXMLDOMNodePtr Pin
led mike8-Oct-07 4:25
led mike8-Oct-07 4:25 
GeneralRe: Problem in passing a VARIANT to IXMLDOMNodePtr Pin
Rocky#8-Oct-07 18:33
Rocky#8-Oct-07 18:33 
AnswerRe: Problem in passing a VARIANT to IXMLDOMNodePtr Pin
myshketer9-Oct-07 2:24
myshketer9-Oct-07 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.