Jump to content
The simFlight Network Forums

PhilipManwaring

Members
  • Posts

    6
  • Joined

  • Last visited

About PhilipManwaring

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

PhilipManwaring's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. OK - I found the problem. For whatever reason, VB only lets you declare one variable of complex type per DIM line. Once I put each struct on a separate DIM statement, it worked fine. Thanks so much for helping me on this! :)
  2. Chris, Thanks for your help with this - the solution you've presented is much more elegant than what I was doing. Unfortunately, my problem persists and I'm now starting to think it has something to do with the way VB is handling the FSUIPC calls themselves. When I look in the Locals broswer after the process call, my variable has lost its data type - not even an LLCoordinates struct anymore. Bizarre. Here's a link to a screenshot. http://www.aavirtual.com/forums/attachment.php?s=&postid=19452
  3. I'm new to programming with FSUIPC, and have started a little utility in VB. I'm working with the very helpful VB modules provided in the SDK but have a problem that hopefully is due to a simple error on my part. I've set up a simple applicate to connect to FSUIPC and read the current Lat/Lon coordinates. I start FS (FS2002 or FS9 - same symptom), place the aircraft at the default field, and then run my app. The app connects to FSUIPC and reports the correct version number. It then tries to read the 8 bytes at location #0560 to get the latitude. In fact, I'm really just using the sample code in the VB readme file. Code is as follows: Private Sub UpdatePosition() ' Dim Fake64Bit1, Fake64Bit2 As Currency Dim dwResult As Long Dim Longitude, Latitude As Double ' If Active Then If FSUIPC_Read(&H560, 8, VarPtr(Fake64Bit1), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then Latitude = Fake64Bit1 * 10000# Latitude = Latitude * 90# / (10001750# * 65536# * 65536#) lblLatitude.Caption = Str(Latitude) Else lblStatus.Caption = "Processing: " & ResultText(dwResult) End If Else lblStatus.Caption = "Read: " & ResultText(dwResult) End If End If End Sub What happens is that Fake64Bit1 reports as 'empty'. This is odd, since I thought it had to at least take a value of zero. Can anybody tell me what I'm doing wrong? Thanks for any assistance you can provide, Philip.
×
×
  • 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.