Hello!
I started using FSUIPC for developping and I feel stick about something which is annoying me since 3 hours.
public double getAltitude()
{
Offset<long> altitudereq = new Offset<long>(0x0570);
try { FSUIPCConnection.Process(); } catch (FSUIPCException ex) { }
double altitude = (double)altitudereq.Value * 3.28084D / (65536D * 65536D);
altitude = Math.Round(altitude);
return altitude;
}
public double getAirspeed()
{
Offset<int> airspeedreq = new Offset<int>(0x02B8);
try { FSUIPCConnection.Process(); } catch (FSUIPCException ex) { }
double airspeed = (double)airspeedreq.Value / 128;
airspeed = Math.Round(airspeed);
return airspeed;
}
public double getHeading()
{
Offset<double> headingreq = new Offset<double>(0x0580);
try { FSUIPCConnection.Process(); } catch (FSUIPCException ex) { }
double heading = (double)headingreq.Value * 360 / (65536D * 65536D);
heading = Math.Round(heading);
return heading;
}
public double getFPM()
{
Offset<short> FPMreq = new Offset<short>(0x0842);
try { FSUIPCConnection.Process(); } catch (FSUIPCException ex) { }
double FPM = (double)FPMreq.Value * 3.28084;
FPM = Math.Round(FPM * -1);
return FPM;
}
I'm just getting an error 15 if I am removing the try/catch, and blank returns if I let them.
All my code is working, but this part won't. FSUIPConnection.Open() works well too.
Do somebody have an answer ?
Noah
(Sorry for the mistakes, I am not an english native speaker :/ )