Im a complete newbie and wondered if any veterans could help me getting started with FSUIPC in vb .net.
I want to make a small demo which reads the aircrafts current alltitude and displays it in a textbox.
In the fsuipc shell.vb form/module. I've added a button component (button1) and a textbox component (textbox1).
I've tried the follwing code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i
'Open/connect to fsuipc
Call FSUIPC_Initialization()
'Try to call altitude data at offest 0x0020 size 4
FSUIPC_Get(32, 4, i)
'Didn't work returns blank :(
'FSUIPC_Get(32, i)
MsgBox(i)
TextBox1.Text = i
'Close
Call FSUIPC_Close()
End Sub
Im pretty sure I've got the intialize part right, because it works when FS is open, and doesn't work when it's not open.
However the FSUIPC_Get() procedure just returns and empty variable.
Maybe I've got something wrong with the variable types. Im sure the offset is right, it should be 0x0020 hex = 32 dec.
Any help would be much appreciated.
-Kinetic