From: Ian M. <ianm@ActiveState.com> - 2003-11-27 04:11:52
|
I've commited this change. Thanks Jan . Ian Jan L=F8nsetteig wrote: > Hi there, > > I=92ve found a bug in the VB6 task. If the CurrentCulture is different=20 > from us-en. (eg. Norwegian) the double.Parse statements used in=20 > parsing the majorver, minorver and lcid values in the project file=20 > crash. double.Parse is culture dependant. > > Could someone with access be so kind to update the VB6Task.cs file=20 > with the following fix: > > System.Globalization.NumberFormatInfo nfi =3D new=20 > System.Globalization.CultureInfo( "en-US", false ).NumberFormat; //Fix > > // # Added to properly cast the parts of the version # > > // Ensure that we use the correct cast option > > string temp =3D match.Groups["majorver"].Value; > > ushort majorVer =3D (-1 < temp.IndexOf(".")) ?=20 > (ushort)double.Parse(temp, nfi) : ushort.Parse(temp); //Fix > > temp =3D match.Groups["minorver"].Value; > > ushort minorVer =3D (-1 < temp.IndexOf(".")) ?=20 > (ushort)double.Parse(temp, nfi) : ushort.Parse(temp); //Fix > > temp =3D match.Groups["lcid"].Value; > > uint lcid =3D 0; > > if (0 < temp.Length) { > > lcid =3D (-1 < temp.IndexOf(".")) ? (uint)double.Parse(temp, nfi) :=20 > uint.Parse(temp); //Fix > > } > > The only change I have made is to introduce the NumberFormatInfo=20 > variabel and passed it to the 3 Parse statements. > > It works fine with this fix. > > Regards, > > Jan L=F8nsetteig > *_Senior System Developer_* > jan...@fi... > --=20 Ian MacLean, Developer,=20 ActiveState, a division of Sophos http://www.ActiveState.com |