It's been a (long) while since I've been in the world of Microsoft COM.
I've got a couple of classes (FooA and FooB) which are part of a static unmanaged C++ library.
Rather than figuring out the nightmare of header file inclusion resolution, I'd like to wrap this library in a COM object. Doing so would make the library available for consumption by C# (managed) clients.
The 1st pass of the COM object is to be single thread apartment (we might switch to multi thread later).
This is where I'm a little rusty and get a little confused.
I have classes FooA and FooB contained in the library.
FooA and FooB have methods which I'd like to expose to clients.
class FooA {
public Method1;
public Method2;
}
class FooB {
public Method3;
public Method4;
}
How do I expose those classes and methods their methods through a COM interface?
Ultimately I need an instantiation of the class (an object) to reference methods on that object.
Do I need to return and pass around a ptr to the instantiated object to interfaces exposed on the COM object?
A lot of the examples I've seen are pretty standard: add/multiply two integers
Can someone shed some light on this for me and perhaps point me towards a useful example?
Thanks,
JohnB