bapilot54 Posted August 25, 2009 Report Posted August 25, 2009 Hi, I`m wondering if anybody can help me with what is probably an easy fix. I want to write the command to load a saved flight from within a visual basic instructors station I am writing. Whener I give it a value to load I get a VB exception. eg.. Dim flight As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&3F00, True) Private Sub btnload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnload.Click flight.value = savedflight1.flt End Sub Any help would be appreciated, I am but a novice at this :) Thankyou in advance
Achilles Philippopoulos Posted August 25, 2009 Report Posted August 25, 2009 To load or save a Flight (.FLT) you first set up the pathname (and optional description) at offset 3F04 below, then write here. Write one of these values: 0 to simply load the specified flight/situation. 1 to save the flight/situation with no description 257 to save the flight/situation with a description Flights are saved in the ―My Documents‖ FS folder. Flights are loaded by default from there too – you don‘t have to specify a path. If you are Loading a file, please allow time for the file to load before expecting any further meaningful response across the FSUIPC interface. FSUIPC will probably not be able to respond for several seconds even on the fastest machines. Hi, I`m wondering if anybody can help me with what is probably an easy fix. I want to write the command to load a saved flight from within a visual basic instructors station I am writing. Whener I give it a value to load I get a VB exception.eg.. Dim flight As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&3F00, True) Private Sub btnload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnload.Click flight.value = savedflight1.flt End Sub Any help would be appreciated, I am but a novice at this :) Thankyou in advance
bapilot54 Posted August 26, 2009 Author Report Posted August 26, 2009 Hi, many thanks for your swift reply, I am just wondering how the code is written in VB to make this happen? I am very novice at this! Thanks in advance, Chris
Achilles Philippopoulos Posted August 26, 2009 Report Posted August 26, 2009 Hi, many thanks for your swift reply, I am just wondering how the code is written in VB to make this happen? I am very novice at this!Thanks in advance, Chris I did't check it but it will work Private Sub btnload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnload.Click 'if fsuipc not already open then add the bellow Try FSUIPCConnection.Open() end try Try FSUIPCConnection.Process() Dim loadsave As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&3F00) Dim flightname As Offset(Of string) = New FSUIPC.Offset(Of string)(&3F04, 252) flightname.value="savedflight1.flt" loadsave.value=0 ' to simply load the specified flight/situation. 'loadsave.value=1 ' to save the flight/situation with no description 'loadsave.value=257 ' to save the flight/situation with a description End Try end sub
bapilot54 Posted August 26, 2009 Author Report Posted August 26, 2009 Hi mate, many thanks for your help. I will let you know how I go on. Once again many thanks the sim world needs people like you. Regards Chris
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now