Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtGridCellNumber fails when operating system language changes Collapse All
Subject Author Date
Pat McLeod Jun 25, 2012 - 8:21 AM

The following happens when I change my operating system’s language:


 


pCell->TextSet(_T("0.003"));


pCell->TextGet(strCopy); // strCopy == "3.00"


 


The problem seems to happen inside void CExtGridCellVariant::TextSet when this line is invoked:


HRESULT hr = ::VariantChangeType( this, &varSrc, 0, vt );


 


varSrc is indeed 0.03, yet the text value set is "3.00"


 


Can someone please explain this behavior so I can prevent it from happening?

Technical Support Jul 5, 2012 - 10:02 AM

OLE VARIANT APIs require number strings formatted according the current locale settings. You probably should use 3,00 instead of 3.00. Alternatively, you can convert text to a number in your code and initialize text value using the double value.