Hi everyone,
I am using phenty's VB .Net dll to communicate with FSUIPC. What I am trying to do is to read the FS Com2 frequency, and I have already managed to do that via the code below...
Dim com2bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H3118)
FSUIPCConnection.Process()
Dim com2String As String = com2bcd.Value.ToString("X")
com2String = "1" & com2String.Substring(0, 2) & "." & com2String.Substring(2, 2)
me.label1.text = com2string
The issue is that this code can only be executed when a flight has been loaded, in other words when the aircraft has loaded and not from the FS main menu. If I execute while FS is in the main menu I get a .Net error which I understand because a Com2 frequency is not present.
My question now is if there is a way to detect that FS has loaded a flight and is not in the Main Menu anymore. This way I can add an If...End statement in my timer and check whether an FS flight has loaded and if it has then get the com2 frequency but if it has not loaded then continue the timer until it loads.
I hope you understand what I am trying to do :D
Thanks in advance,
Alex