Jump to content
The simFlight Network Forums

BoXon

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by BoXon

  1. Everything went just fine until a friend of mine discoverd a bug in the program, it thinks that the aircrafts longitude is 243 degrees while it actually is 116 degrees.

    No problem in europe, the position report in the program is correct, this bug occured while my friend was flying in western canada.

    Anybody know how to correct it?

    A code sample:

           
    Dim lon As Offset(Of ULong) = New FSUIPC.Offset(Of ULong)(&H568)
    ...
    'Longitude=
    Dim real_lon As Double
    real_lon = lon.Value * 360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0)
    lon_label.Text = real_lon

  2. Hello!

    Does anyone know if there is possible to start a flight in FS through my own application at a certain time, airport and with a specific aircraft?

    Like, i'm having a button -> "Start FS at XXXX with PMDG747 at 2009-02-24 13:30", this would start FS, loading the PMDG747 at the airport XXXX (converted to long/lat positions of course?) with the current time set to: 2009-02-24 13:30.

    Don't know if this has anything to do with FSUIPC, but as this is a great forum with alot of experienced programmers, maybe someone could help anyway. :)

    Thanks!

  3. Well, atleast i got it to read something.

    But my heading is 224, but my code reads -117,735343845561

    What am i doing wrong? :?

    Imports FSUIPC
    Public Class Form1
    
        Dim hdg As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H580)
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
    
                ' Attempt to open a connection to FSUIPC (running on any version of Flight Sim)
    
                FSUIPCConnection.Open()
    
                ' Opened OK
                Timer1.Enabled = True
    
            Catch ex As Exception
    
                ' Badness occurred - show the error message
    
                MessageBox.Show(ex.Message, "skyCARS", MessageBoxButtons.OK, MessageBoxIcon.Error)
    
            End Try
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            FSUIPCConnection.Process()
            Dim hdg2 As Double = hdg.Value * 360.0 / (65536.0 * 65536.0)
            Label1.Text = hdg2
        End Sub
    End Class

  4. Hello!

    I have now successfully connected to FSUIPC, but a problem occurs then i'm trying to read values:

    Error 1 Constant expression not representable in type 'Integer'.

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            FSUIPCConnection.Process()
            Dim hdg As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H580)
            Dim hdg2 As Double = hdg.Value * 360 / (65536 * 65536)
            Label3.Text = hdg2
    
        End Sub

    Using VB 2008 Express

  5. Hello once again!

    I have a little trouble sending messages to FS, realy odd...

    What happens is that the messages appears fine in FS, but each time it's updated (using a VB timer) it's changing style, so somtimes it's red and scrolling,

    somtimes it's white and not scrolling, sometimes it's red not scrolling and somtimes it's white and scrolling. I cannot understand why it's a "random" style?

    As you can se here in my code, everything should be correct for a standard "NON SCROLLING MESSAGE" ?

    Function paxBoarding(pax)
    
        If dwResult = "0" Then
            boardedPax = boardedPax + 1
            If boardedPax <> pax Then
    
            main.logg.AddItem (boardedPax)
            If FSUIPC_WriteS(&H3380, 128, "Aircraft is boarding: " & boardedPax & " of " & pax & " passangers has boarded.", dwResult) And FSUIPC_Write(&H32FA, 2, VarPtr("0"), dwResult) And FSUIPC_Write(&H1274, 2, VarPtr("0"), dwResult) Then FSUIPC_Process (dwResult)
    
            Else
    
            main.logg.AddItem ("Boarding klart! " & boardedPax & " passagerare ombord")
            main.checkForFSTimer.Enabled = True
    
            End If
        End If
    
    End Function

    Please some VB-guru, help me solve this problem! :(

  6. Hey!

    I have a problem once again, i'm trying to read the current Longitude & Latitude of my aircraft in FS, but using this code:'

    Dim dwResult As Long

    Dim longfake As Currency

    Dim currentLong As Double

    Call FSUIPC_Read(&H568, 8, VarPtr(longfake), dwResult)

    Call FSUIPC_Process(dwResult)

    currentLong = longfake * 10000#

    currentLong = currentLong * 360# / (65536# * 65536# * 65536# * 65536#)

    longitude.Text = currentLong

    ------------------------------------------------------------------------------------------

    It returns something like this:

    -123,029740092334

    Thats not what i want? :shock:

  7. As the program key is in the .exe comment field, i can only test it outside VB, and then i complie it to an .exe i get no errors. :?

    Hmmm, an FSUIPC registration would help there then. I didn't realise you hadn't even bought FSUIPC! :-(

    Pete

    Nope, i only have the freeware key for the .exe recived from you.

    But i will buy it, cuse when i started to work with FSUIPC i discovered

    all the work included in it! Great work! :D

    Now it would be great if someone could help me getting my program working? 8)

  8. I have removed some Process calls now as you see bellow. :wink:

    Do you meen like this?

    No, I mean do one (1) process call for ALL the reads you want to do this cycle, not just arbitrarily bach them still with multiple calls to FS for no good reason. would you take separate trips to the supermarket to get three different things if you knew you wanted them all before you went the first time?

    You only need to separate them if you need the results of one read to decide what else to read, or to decide upon something to write.

    But i'm still getting the same error... :(

    But that's a VB error, and the VB compiler or debugger will tell you precisely what is wrong, surely? That is why you use such a terrible language (my opinion, of course), isn't it? Because it is supposed to be easy? Surely it doesn't give obscure compile or runtime errors with no explanation?

    Sorry, but I cannot help with VB. Try me on C. Maybe someone else will help, but if VB never tells you where it failed I don't see how you can use it in the first place. :-(

    Regards,

    Pete

    3 different shops ? :wink:

    As the program key is in the .exe comment field, i can only test it outside VB, and then i complie it to an .exe i get no errors. :?

    I'm planning to begin with a C language, but thats after this program is ready. :)

×
×
  • 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.