windows - Decimal separator and CComVariant -
can specify decimal separator used / used ccomvariant ?
context: msmxml (ixmldomelementptr.getattribute) returns ccomvariant initialized vt_bstr regardless attribute type. therefore end decimal values stored in bstr '.' decimal separator. when windows configured coma ',' decimal separator, ccomvariant unable make conversion double or float.
example:
ccomvariant dummy = "1.2345"; dummy.changetype(vt_r8); if(dummy.vt != vt_r8) { cout << "failed convert" << endl; } else { cout << dummy.dblval << endl; }
when windows' decimal separator coma, fall in "failed convert". tried set std::locale::global(std::locale("english_united states.1252"))
nothing changed.
Comments
Post a Comment