A
Anuchen
Guest
Hello,
There are a couple of COM interfaces with proprietary implementations:
Weather System Service
I am able to access the weather-related functions they provide and read the weather parameters if i write plugins that can be invoked by P3d.
But my requirement is to access them from a C# client console, which means I need COM objects. Only the header files are available.
So I thought if I could write an idl based on the header file, I could compile it to generate the corresponding tlb and include these in my C# project, and call them.
1. Would this approach work?
2. When I tried to create the idl, I attempted to include the header file in it as:
import "oaidl.idl";
import "ocidl.idl";
import "unknwn.idl";
[
object,
uuid(27075dbf-09fc-4e5a-8808-f7a81525d075),// the iid of the iweathersystem interface
helpstring("interface to access PDK weather parameters")
]
interface IWeatherSystemV430 :IUnknown
{
include "IWeatherSystem.h"
CLOUD_COVERAGE_DENSITY GetCloudCoverageDensity();
HRESULT SetCloudCoverageDensity(__in CLOUD_COVERAGE_DENSITY eDensity);
..........
..........
}
But I get the error: expecting a type specification near "include". Trying import too doesn't work. Can you please guide me on how to resolve this?
Thank you
Continue reading...
There are a couple of COM interfaces with proprietary implementations:
Weather System Service
I am able to access the weather-related functions they provide and read the weather parameters if i write plugins that can be invoked by P3d.
But my requirement is to access them from a C# client console, which means I need COM objects. Only the header files are available.
So I thought if I could write an idl based on the header file, I could compile it to generate the corresponding tlb and include these in my C# project, and call them.
1. Would this approach work?
2. When I tried to create the idl, I attempted to include the header file in it as:
import "oaidl.idl";
import "ocidl.idl";
import "unknwn.idl";
[
object,
uuid(27075dbf-09fc-4e5a-8808-f7a81525d075),// the iid of the iweathersystem interface
helpstring("interface to access PDK weather parameters")
]
interface IWeatherSystemV430 :IUnknown
{
include "IWeatherSystem.h"
CLOUD_COVERAGE_DENSITY GetCloudCoverageDensity();
HRESULT SetCloudCoverageDensity(__in CLOUD_COVERAGE_DENSITY eDensity);
..........
..........
}
But I get the error: expecting a type specification near "include". Trying import too doesn't work. Can you please guide me on how to resolve this?
Thank you
Continue reading...