COM within a COM

Hi,
Im new to C++, but have created an ATL COM project in which I want to use the methods, properties and events of another COM object.
Can anyone point me to some examples of how to use another COM dll within my new DLL rather than text full of words that I have never heard of.
Thanks
A COM component can only be reused by means of Aggregation or containment. Look up those terms in order to understand.

If you don't really want to bother learning something new about COM, go for containment, which basically means you instantiate an instance of the required COM object and keep it referenced using a class-level private variable.

1
2
3
4
5
6
7
8
class MyCOM : ....
{
private:
    CComPtr<MyContainedCOMInterfaceType> _contained;

    //I haven't done ATL in several years.  I think there's an Init() or FinalConstruct() method.
    //In that method instantiate your COM object and make '_contained' point to it.
}
Topic archived. No new replies allowed.