Hi Pete!
I'm trying to read the heading offset 0x580 in C + +. Based on the examples you provide in the FSUIPC SDK, there you proceed to read from offset 0x238, 0x239 and 0x23a. But with any other offsets always results in the same display in Printf 2293232. My idea is to collect and send the offset to a serial port which will control a pic showing the position of the servo gauge. Everything is ready, the difficulty is in reading the same offset. There is some code to release the offset gauge?. Recently got the key FSUIPC.
Thanks
Junior
#include "stdafx.h"
#include <time.h>
#include <windows.h>
#include "FSUIPC_User.h"
#include "IPCuser.h"
char *pszErrors[] =
{ "Ok",
"Attempt to Open when already Open",
"Não foi possível o link com o FSUIPC",
"Failed to Register common message with Windows",
"Failed to create Atom for mapping filename",
"Failed to create a file mapping object",
"Failed to open a view to the file map",
"Incorrect version of FSUIPC, or not FSUIPC",
"Sim is not version requested",
"Call cannot execute, link not Open",
"Call cannot execute: no requests accumulated",
"IPC timed out all retries",
"IPC sendmessage failed all retries",
"IPC request contains bad data",
"Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC",
"Read or Write request cannot be added, memory for Process is full",
};
if (FSUIPC_Open(SIM_ANY, &dwResult))
{ char chMsg[128], chTimeMsg[64];
unsigned int Heading[32];
BOOL fTimeOk = TRUE;
static char chOurKey[] = "123456789ABC";
if (FSUIPC_Write(0x8001, 12, chOurKey, &dwResult))
FSUIPC_Process(&dwResult);
if (!FSUIPC_Read(0x580, 4, Heading, &dwResult)||
!FSUIPC_Process(&dwResult)) // Process the request(s)
fTimeOk = FALSE;
if (fTimeOk)
printf("HEADING = %d\n\n",Heading);
else
printf("Request for time failed: %s\n\n", pszErrors[dwResult]);
}
else
printf ("PTEPS: Falha ao abrir link para FSUIPC\n\n\n", 0) ;
FSUIPC_Close(); // Closing when it wasn't open is okay, so this is safe here
return 0
}