May 9, 200224 yr Hi all, (-:I need some help regarding COM and NAV frequencies from FSUIPC.I am currently programming on my homesim, but I got some troubles reading COM and NAV values from FSUIPC.I program i VB (Visual basic) and everytime i read from the offset H034E in FSUIPC I got some strange values.I expect regarding to Peter Dowson
May 9, 200224 yr I tried it and it seemed to work as described. I've included the code I used. I am going to assume you are using the FSUIPC.bas module supplied in the FSUIPC SDK for VB.The code assumes you've already 'connected' to flight sim. The code ran off a button called Command1 and put the converted Hex value into a textbox called 'txtCom'.(Sorry the indentations are lost in HTML so it looks messy. Should cut and past OK though...)------------------------------------Private Sub Command1_Click()Dim intComFrequency As IntegerDim dwResult As Long' Set-up the read for the com1 offset (for 2 Bytes)...FSUIPC_Read &H34E, 2, VarPtr(intComFrequency), dwResult' Do the read...If FSUIPC_Process(dwResult) Then ' Convert into a string in hex format and display in text box Me.txtCom = Hex(intComFrequency)else MsgBox "Error " & dwResultend ifEnd Sub-------------------------------------If I tune com1 to 123.45 I get back 0x2345 (9029 in decimal).If you have any more questions, just ask...PaulEGJJ
May 9, 200224 yr Thank you Paul,It worked well this time. Now I see the point by using your example.Great :-smile12
Create an account or sign in to comment