Search code examples
visual-studio-2008locale

How to define the locale of an application in .NET


I have an application developted with Visual C++ 2008 Express Edition under Windwos XP, which runs propertly on one computer, where the default langaunge is set to English. However, if run the same application on a different computer with default language German, I run into troubles because a predefined string Infinity is not recoginzed during conversion to double using ToDouble, because on the German platform the string should be Unendlich. In particular the mscorlib throws correctly a FormatException.

How can I force the application to run with the English locale? I could not yet find any option...

Thanks for any hint.


Solution

  • Use Convert::ToDouble(str, System::Globalization::CultureInfo::InvariantCulture);