EnableRestrictToContainer example for C++ 5 and later
//'This examples toggles the "restrict to container" property.
//'If an object is restricted to the container, no part of it can be moved outside the container
void CTutorDlg::ExampleAnnSetRestrictToContainer(long hObject)
{
VARIANT_BOOL bRestrict;
bRestrict = m_pRasterAnn->GetEnableRestrictToContainer(hObject);
bRestrict = !bRestrict;
m_pRasterAnn->PutEnableRestrictToContainer(hObject,bRestrict);
if (bRestrict == TRUE)
MessageBox (TEXT("Restricted To Container"));
else
MessageBox (TEXT("Not Restricted To the Container"));
}