papalima Posted July 2, 2005 Report Posted July 2, 2005 Hello, I'm trying to receive the dme (offset 0C29), using FSUIPC_Get. But how do I convert the value into a string??? My code: Private Sub GetDME1() Dim intToken As Integer Dim dwResult As Integer Dim bteDME1() As Byte???????????? If Not FSUIPC_Read(&HC29, 5, intToken, dwResult) Then lblMessage.Text = "read error code: " + dwResult.ToString Else If Not FSUIPC_Process(dwResult) Then lblMessage.Text = "process code: " + dwResult.ToString End If FSUIPC_Get(intToken, 5, bteDME1)????????? lblDME1.Text = ???????????? End If End Sub Thanx,
Pete Dowson Posted July 2, 2005 Report Posted July 2, 2005 I'm trying to receive the dme (offset 0C29), using FSUIPC_Get. But how do I convert the value into a string??? Well, in FS, Windows, and C/C++ terms, it IS a string already -- a sequence (array if you like) of bytes each containing a printable ASCII character value, ending with a zero byte. As far a VB is concerned, I'm sorry, but I've no idea. VB seems to have trouble with strings, numbers, almost everything. I'll have to leave it to someone else, hopefully, to look at your code and comment. Regards, Pete
papalima Posted July 3, 2005 Author Report Posted July 3, 2005 After playing around a bit, I found the error; here is the correct code: Private Sub GetDME1() Dim intToken As Integer Dim dwResult As Integer Dim x(4) As Byte lblDME1.Text = String.Empty If Not FSUIPC_Read(&HC29, 5, intToken, dwResult) Then lblMessage.Text = "read error code: " + dwResult.ToString Else If Not FSUIPC_Process(dwResult) Then lblMessage.Text = "process code: " + dwResult.ToString End If FSUIPC_Get(intToken, 5, x) For i As Integer = 0 To x.Length - 1 lblDME1.Text &= Trim(Chr(x(i))) Next End If End Sub
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