hello everyone,
I am trying to write a basic C++ program to read data from flight sim.
I am able to compile and run my program, however ever i get error code 2 when trying to open the connection to flight stim using FSUIPC_open.
I am able to succesfully run the sample program that comes with the sdk (UIPCHello).
Yes, flight sime is open and I am running my program with admistrator priviliges.
I have attched my code for further reference. Any insight would be greatly appreciated.
#include
#include
#include
#include
#include
#include
using namespace std;
int main()
{
ofstream data;
data.open("data.txt");
DWORD dwResult;
int result;
double *acceleration;
double value;
int i;
FSUIPC_Open(SIM_ANY, &dwResult);
cout<
acceleration=&value;
*acceleration=20.0;
for(i=0;i<10;i++){
FSUIPC_Read(3090,8 , acceleration, &dwResult);
FSUIPC_Process(&dwResult);
result=dwResult;
cout<
data<
Sleep(1000);
}
data.close();
return 0;
}