Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Right, I have a problem.

I am currently trying to develop a flight tracking system in visual basic express for my virtual airline (jetengland.com).

I have run into a problem which has stopped development.

Is there a vbexpress package for the FSUIPC module?

I have tried converting the VB6 package into visual basic express code (using vbe built in tools) but to no avail.

What I'm basically trying to do is get the longitude and latitude, altitude, groundspeed, airspeed & remaining NM from FSUIPC (if they are all possible).

Here is what i have so far:

Form1.vbs:

Public Class jet_england_main_form
    Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click
        Close()

    End Sub
    Dim hdg As Offset(Of UInteger) = New FSUIPC.Offset(Of UInteger)(&H580)
    Dim magvar As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H2A0)
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        FSUIPCConnection.Process()
        Dim hdgTrue As Double = hdg.Value * 360.0 / (65536.0 * 65536.0)
        Dim hdgMag As Double = hdgTrue - (magvar.Value * 360.0 / 65536.0)
        If hdgMag < 0 Then
            hdgMag += 360
        ElseIf hdgMag > 360 Then
            hdgMag -= 360
        End If
        Dim SendLongLat As New System.Net.WebClient
        Dim SendLongLatR As New System.IO.StreamReader( _
       SendLongLat.OpenRead("http://www.application.jetengland.com/send_update.php?longitude="))
        Dim Contents As String = SendLongLatR.ReadToEnd()
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OpenFSUIPC()
        FSUIPCConnection.Process()
        Me.txtHeadingAtStartup.Text = compass.Value.ToString("F2")
        ToolStripStatusLabel1.Text = "Error connecting to the application server!"
        Dim ToolStatusStripLabelInfo As New System.Net.WebClient
        Dim file As New System.IO.StreamReader( _
       ToolStatusStripLabelInfo.OpenRead("http://www.application.jetengland.com/get_status.php"))
        Dim Contents As String = file.ReadToEnd()
        file.Close()
        ToolStripStatusLabel1.Text = Contents

    End Sub

    Private Sub MToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MToolStripMenuItem.Click
        MsgBox("An error occured: jEE001XXC", MsgBoxStyle.Critical, "Error!")
    End Sub

    Private Sub FileAFlightPirepToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileAFlightPirepToolStripMenuItem.Click
        MsgBox("Why would you want to do this if the program logs everything for you! Don't worry, we get all your stalls aswell, leave it all to us :]", MsgBoxStyle.Information, "Sorry!")
    End Sub

    Private Sub LoginToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginToolStripMenuItem.Click
        Login_Box.Show()
    End Sub

    Private Sub ForgotPasswordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForgotPasswordToolStripMenuItem.Click
        ForgotPassword.show()
    End Sub

    Private Sub ServerStatusToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ServerStatusToolStripMenuItem.Click
        ServerStatus.Show()
    End Sub

    Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
        AbowtBoksWon.Show()
    End Sub

    Private Sub ToolStripStatusLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripStatusLabel1.Click


    End Sub

    Private Sub FileAFlightPlanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileAFlightPlanToolStripMenuItem.Click

    End Sub
End Class

The errors that I am getting are:

Error 1 Type 'Offset' is not defined. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 7 16 jetEngland Flight Monitor

Error 2 Type 'Offset' is not defined. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 8 19 jetEngland Flight Monitor

Error 3 Name 'FSUIPCConnection' is not declared. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 10 9 jetEngland Flight Monitor

Error 4 Name 'OpenFSUIPC' is not declared. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 24 9 jetEngland Flight Monitor

Error 5 Name 'FSUIPCConnection' is not declared. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 25 9 jetEngland Flight Monitor

Error 6 'txtHeadingAtStartup' is not a member of 'jetEngland_Flight_Monitor.jet_england_main_form'. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 26 9 jetEngland Flight Monitor

Error 7 Name 'compass' is not declared. C:\Users\Domm\Documents\Visual Studio 2008\Projects\jetEngland Flight Monitor\jetEngland Flight Monitor\Form1.vb 26 39 jetEngland Flight Monitor

Thanks in advance,

Dominic Lipscombe.

Posted

Is there a vbexpress package for the FSUIPC module?

Is VBexpress that much different from VB?

I have tried converting the VB6 package into visual basic express code (using vbe built in tools) but to no avail.

What VB6 package? Is the FSUIPC SDK there's a "VisualBasic" package and a "VB.NET" package. I see nothing marked "VB6".

What I'm basically trying to do is get the longitude and latitude, altitude, groundspeed, airspeed & remaining NM from FSUIPC (if they are all possible).

I'm not sure what you mean by "remaining NM" -- you can get the fuel quantities and if you know the fuel consumption you could work that out. But the others are straight-forward.

Here is what i have so far:

None of that looks even remotely derived from the example in the VisualBasic ZIP in the SDK. Are you sure you aren't looking instead at Paul Henty's useful .NET DLL provisions? If so it sounds like you aren't following the rules for that package.

Regards

Pete

Posted

If you are using the VB 2008 Express version you should definitely be using the VB.Net example code rather than trying to get the old VB6 examples running. Like Pete notes, if you have not already done so, I'd actually highly recommend that you look at Phenty's FSUIPC Client DLL for .Net (viewtopic.php?f=54&t=53255) which makes things even simpler.

Jeff

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.