AnnGetContainer example for Visual C++ 4.0
OLE_HANDLE hPin, h1, h2, hCont;
hCont = m_Lead1.AnnCreate (ANNOBJECT_CONTAINER, TRUE, FALSE);
if(hCont != 0)
{
hPin = m_Lead1.AnnCreateItem (hCont, ANNOBJECT_PUSHPIN, FALSE);
h1 = m_Lead1.AnnGetContainer (hCont);
h2 = m_Lead1.AnnGetTopContainer (hPin);
if(h1 == h2 && h1 == m_Lead1.GetAnnContainer ())
AfxMessageBox("root container is same as that of LEAD1");
}