AnnSelect example for C++ 5.0 and later
For details on event handling of the COM objects in MFC, and m_pDlg and m_pRasterAnn declarations, refer to the "Creating and Using Annotations (C++ 5.0 and later) Tutorial"
void CRasterAnnSink::OnAnnSelect(ILEADRasterVariant * pltRasVar, short uCount)
{
AnnObjectType nType;
long x;
int nPolyCount;
CString strMsg= TEXT("");
long hObject;
nPolyCount = 0;
for (x = 0; x < uCount; x++)
{
hObject = pltRasVar->LongItemValue (x);
m_pDlg->m_pRasterAnn->AnnGetType(hObject);
nType = m_pDlg->m_pRasterAnn->GetAnnType();
if (nType == ANN_OBJECT_POLYGON)
nPolyCount++;
}
strMsg.Format(TEXT("%d objects were selected. %d Polygon Objects were selected."), uCount, nPolyCount);
AfxMessageBox(strMsg);
}