A thirdparty vendor has provided a COM interface as an external API to their product, and for sending instructions to it, it's fine with the mechanism of generating class wrappers with visual studio by importing from the dll, then creating instances of the created classes, calling their CreateDispatch(), using the access functions and releasing when done.
For return notifications, I'd normally create an EventsListener class derived from IDispatch using the Invoke function to handle events returning from the interface.
This vendor has created an Events class which I have to wrap and expose, then explicitly tell the installation where to look. all the example are given is C# where it's really easy, but I'm struggling on how to do it in C++
in the C# example provided with the API, the interop dll provided is simply added as a reference and derived into a class like so:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Text;
using <THIER INTEROP LIB>
namespace some.example.namespace
{
[ComVisible(true)]
public class EventViewer : IEvents //where IEvents is their events class
{
public void OnEvent(EventID EventID, object pData) //overridden function
{
//event handled here
}
}
}
In broad terms I assume that I must create a COM interface, since they require a ProgID from me to instantiate, but how do I derive that's been wrapped by the import and then expose the created class to COM
I'm just not sure where to even start, as all the tutorials I've seen so far talk in terms of creating brand new classes not wrapping a third party one