Jump to content
The simFlight Network Forums

Get Flight Simulator Language


Recommended Posts

Hey Pete,

I've been working on an ACARS for my VA recently and have come up on a little problem. When I use FSUIPC to get the longitude and latitude for foreign FS software (like FS2004 from Denmark), it will output the latitude and longitude with periods instead of commas (i.e. US version: 34.145, Denmark version: 34,145). Is there a FSUIPC offset that will tell me the country/language where the FS came from or will I just have to use my VB.NET skills to change them manually.

Thanks,

Wesley

Link to comment
Share on other sites

I've been working on an ACARS for my VA recently and have come up on a little problem. When I use FSUIPC to get the longitude and latitude for foreign FS software (like FS2004 from Denmark), it will output the latitude and longitude with periods instead of commas (i.e. US version: 34.145, Denmark version: 34,145).

You must mean your program will, not FSUIPC. FSUIPC is not formatting anything for you.

Is there a FSUIPC offset that will tell me the country/language where the FS came from or will I just have to use my VB.NET skills to change them manually.

Since it must be your code which is formatting the values, it has to be your code which determines what format to use, surely? And is the country of origin of FS relevant? Surely it is the locale of the user which is relevant. Windows provides these facilities, not FS.

Regards

Pete

Link to comment
Share on other sites

Not sure on that. The guy that has trouble lives in the US but got his MSFS from some country in Europe.

Well here's the VB.NET coding I used to convert the offset:

---

Dim PreLongitude As New FSUIPC.Offset(Of Long)(&H560)

Dim PreLatitude As New FSUIPC.Offset(Of Long)(&H568)

AcLongi = PreLongitude.Value * 90.0# / (10001750.0# * 65536.0# * 65536.0#)

AcLati = PreLatitude.Value * 360.0# / (65536.0# * 65536.0# * 65536.0# * 65536.0#)

---

But then, maybe his computer cultural settings are not setup right. I will check on that.

Thanks,

Wesley

Link to comment
Share on other sites

Not sure on that. The guy that has trouble lives in the US but got his MSFS from some country in Europe.

Yes, but the Lat/Lon you are reading from FSUIPC is NOT in character format. It has no points or commas in it. It is a binary value, not a printable one! In fact, as I see you are reading the 64 bit integer versions in 0560 and 0568 there are no fractions at all in those -- just whacking great integers which you convert to whatever ou wish.

Well here's the VB.NET coding I used to convert the offset:

---

Dim PreLongitude As New FSUIPC.Offset(Of Long)(&H560)

Dim PreLatitude As New FSUIPC.Offset(Of Long)(&H568)

AcLongi = PreLongitude.Value * 90.0# / (10001750.0# * 65536.0# * 65536.0#)

AcLati = PreLatitude.Value * 360.0# / (65536.0# * 65536.0# * 65536.0# * 65536.0#)

Yes, and still there are no character, no points nor commas! They are floating point values in exponent/mantissa form in the binary format dictated by Intel. If you are displaying them later, in a printable form, it is that part of your code which is doing it. It is absolutely nothing whatsoever to do with FS or FSUIPC.

Regards

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.