AnnGetRotateOptions example for Visual C++
// The following example toggles the display of
// rotate handles. If displaying rotate handles, the object
// is changed so that it does not display rotate handles.
// If not displaying rotate handles, the object is changed
// so that it displays rotate handles
int CAnnCOMView::ExampleAnnGetRotateOptions()
{
int nRet;
CString szMsg;
long hObject;
m_pltAnn->AnnCreate(ANN_OBJECT_TEXT, TRUE, TRUE);
hObject = m_pltAnn->GetAnnObject();
m_pltAnn->PutAnnRectLeft(hObject,0);
m_pltAnn->PutAnnRectTop(hObject,0);
m_pltAnn->PutAnnRectWidth(hObject,100);
m_pltAnn->PutAnnRectHeight(hObject,100);
nRet = m_pltAnn->AnnGetRotateOptions(hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES);
if (nRet != 0)
return nRet;
szMsg.Format(TEXT("Old State: AnnShowRotateHandles: %s"), m_pltAnn->AnnShowRotateHandles ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(szMsg);
// Change the state
nRet = m_pltAnn->AnnSetRotateOptions(hObject, !m_pltAnn->AnnShowRotateHandles, 0, ANN_ROTATE_SHOW_ROTATE_HANDLES, FALSE);
if (nRet != 0)
return nRet;
nRet = m_pltAnn->AnnGetRotateOptions(hObject, ANN_ROTATE_SHOW_ROTATE_HANDLES);
if (nRet != 0)
return nRet;
szMsg.Format(TEXT("New State: AnnShowRotateHandles: %s"), m_pltAnn->AnnShowRotateHandles ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(szMsg);
return nRet;
}