Hi everyone,
I have a problem when using offset 3F00 to save the flight.
My little application has a button that, when clicked, should save the flight.
It works the first time and saves the flight correctly.
Each subsequent click does not save the flight. I have to restart my application to get it to save again.
The variables are:
Private Const FltName As String = "NewAutoSave"
'save flight group
Dim oSaveName As Offset(Of String) = New FSUIPC.Offset(Of String)("saveflt", &H3F04, 252)
Dim oSaveCmd As Offset(Of Short) = New FSUIPC.Offset(Of Short)("saveflt", &H3F00)
And the Click event is:
Try
If FSUIPCConnection.IsOpen Then
oSaveName.Value = FltName
oSaveCmd.Value = 1
'write
FSUIPCConnection.Process("saveflt")
lblSaved.Text = $"Saved at:{Now.ToShortTimeString}" 'update Form label
End If
Catch fsex As FSUIPCException
MsgBox(fsex.Message)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Each Click does update the 'Saved at:' label so it is executing the code above it without throwing an Exception.
I have tried running the application as Administrator and there is no difference.
I have tried executing the code on a BackGroundWorker but there is no differerence.
I'm hoping that there is a obvious mistake I've made in my code but I can't see it!
Any help would be appreciated from fellow developers!
Nigel.