AnnGetContainer example for Visual Basic
Dim hPin As OLE_HANDLE, h1 As OLE_HANDLE, h2 As OLE_HANDLE
hCont = LEAD1.AnnCreate (ANNOBJECT_CONTAINER, True, False)
If hCont <> 0 Then
hPin = LEAD1.AnnCreateItem (hCont, ANNOBJECT_PUSHPIN, False)
h1 = LEAD1.AnnGetContainer (hCont)
h2 = LEAD1.AnnGetTopContainer (hPin)
If h1 = h2 And h1 = LEAD1.AnnContainer Then
MsgBox "root container is same as that of LEAD1"
End If
End If