Hello,
I tried to access P3D's Weather Services provided through PDK API . I made a C# console application that invokes C++ code. The code below:
C++
extern "C" __declspec(dllexport) void __stdcall getPressure()
{
printf("Reading global pressure : ");
CComPtr<IWeatherSystemV430> weatherSystem = PdkServices::GetWeatherSystem();
printf("weather system ");
float pressure = weatherSystem->GetGlobalBaroPressure();
printf("%f", pressure);
}
C#
[DllImport("CameraPDK.dll", CallingConvention = CallingConvention.StdCall)]
public static extern voidgetPressure();
static void Main(string[] args)
{
Console.WriteLine("The global pressure is {0}",getPressure());
}
But i wasn't able ti call the GetGlobalBaroPressure systwm and got a System.Access Violation error at that point
Could anyone guide me towards the right approach?
Thank you
I tried to access P3D's Weather Services provided through PDK API . I made a C# console application that invokes C++ code. The code below:
C++
extern "C" __declspec(dllexport) void __stdcall getPressure()
{
printf("Reading global pressure : ");
CComPtr<IWeatherSystemV430> weatherSystem = PdkServices::GetWeatherSystem();
printf("weather system ");
float pressure = weatherSystem->GetGlobalBaroPressure();
printf("%f", pressure);
}
C#
[DllImport("CameraPDK.dll", CallingConvention = CallingConvention.StdCall)]
public static extern voidgetPressure();
static void Main(string[] args)
{
Console.WriteLine("The global pressure is {0}",getPressure());
}
But i wasn't able ti call the GetGlobalBaroPressure systwm and got a System.Access Violation error at that point
Could anyone guide me towards the right approach?
Thank you