What is a good way for an ActiveX control to detect that its container (or container's container) is Internet Explorer?
Currently, I am doing this by calling the control's IOleClientSite::GetContainer method and checking whether the container implements the IHtmlDocument2 interface, but now, I would like to check all of the control's ancestors to see if any of them implement IHtmlDocument.
The problem is that the control is now contained in a CComCompositeControl and created using the CreateActiveXControls(resourceID) method, which creates the inner control as a child of a CAxHostWindow instance. In this case the CAxHostWindow instance reports itself as its own container, so I have not found a way to walk up the tree (if there is such a tree in this model).