Good Day,
I am developing a small home cockpit (as a hobbyist and not as professional) with Microsoft Flight Simulator and the Aerosoft Airbus X. I use a VB.NET app and FSUIPC to connect my hardware to the sim.
Unfortunately this addon is not supported by the FSUIPC so I had to find another way to get the lvars. I have find a sample code (in Airbus X Extended SDK) which act as a gauge (dll) and it is written in C++. I have successfully managed to add new variables to the sample code and had the idea to make them accessible from my VB app. Since I am not familiar with C++, I goggled a lot to figure out how to do it but I have limited success.
When I added the following code to the dll, I can call it (from VB) without problem (as a test).
1 2 3
|
extern "C" __declspec(dllexport) int addFunc(int a, int b){
return (a + b);
}
|
But if I try the code below, I just get "0"
1 2 3 4
|
extern "C" __declspec(dllexport) double getLVar(int c){
ND=currentLVARs.NDMode;
return ND;
}
|
As I understand the code the lvars are stored in the currentLVARs structure
1 2 3 4 5 6 7 8 9 10 11 12 13
|
struct structLVARs
{
double FMAThrottleMode;
double NDMode;
double NDRange;
double FDstat;
//....
//....
//....
};
//internel structure to hold all LVAR values
structLVARs currentLVARs;
|
I have no idea how to reach those variables.
I hope you can help me out and thanks in advance.
elektroby
p.s. I am not a native speaker so please forgive me my English