Hello , everybody.
I've been sufferig from a problem using FSUIPC_READ() during the past one month.
I use FSUIPC 3.48 , VB5 and FS2004.
What I like to do is ,
1. Write a value (f.e. altitude) to FS's MCP via FSUIPC_WRITE().
2. Shortly thereafter , read altitude of FS's MCP via FSUIPC_READ().
I can't get a correct value first, but while trying in severaltimes I can get correct value.
But I'd like to get it as quickly as possible.
My VB code is below.
Please somebody teach me what my mistake.
Best regards
' ----------------------------
Dim FsAlt(4) As Byte
Dim alt As Long
Dim AltFnl as Long
alt = 5000 * 0.3048 * 65536 ' --- alt=5000 ft
Call FSUIPC_Write(&H7D4, 4, VarPtr(alt), dwResult) '---Write alt to FS
Call FSUIPC_Read(&H7D4, 4, VarPtr(FsAlt(1)), dwResult) '--- Read alt from FS
Call FSUIPC_Process(dwResult)
AltFnl = (FsAlt(1) + FsAlt(2) * 256& + FsAlt(3) * 65536 + FsAlt(4) * 16777216) / 19975.3728
'-----------------------------