I'm dealing with the following issue: a (third-party) software (Software A ) we are using extensively allows the programming of what it calls 'extensions' using a Component Object Model (COM) interface (actually several interfaces). It provides the MIDL files for these interfaces as well as a 'project template' for Visual C++ as part of an SDK (IDL files, headers and interfaces are already there, only the implementations for the interface functions are missing). To be comaptible, all extensions have to conform to (i.e. must implement) the given COM interface structure.
However, as my familiarity with C++ is rather limited I was hoping to implement the COM in C# and .NET - on the other hand, the pre-defined interfaces make heavy use of pointers and custom data structures, so I'm wondering if I'm not better off implemementing the interfaces in their native C++ rather than trying to recreate everything in C#.
A little more background maybe: the ultimate goal is to control a piece of custom hardware (via USB) from inside Software A. I have already written a small .NET app wrapping the driver (another third party software) using DLLimport, which was surprisingly painless. In other words, the COM object I am trying to build is essentially a bridge between (third-party) Software A and (third-party) device driver B, which must conform to the interface specifications given by A.
sample MIDL code:
[ id(0x00000004)]
HRESULT GetWaveData([in] BSTR name, [out] IWaveData ** data );
[ id(0x00000005)]
HRESULT GetImageData([in] BSTR name, [out] IImageData ** data, [out] Palette * Palette );
[ id(0x00000006)]
HRESULT SetVariable([in] BSTR name, [in] IVariableData * variable );