AnnAddUndoNode Example for C++ 5.0 and later
For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.
//This example creates two annotation notes as a single undo operation
void CTutorDlg::OnButtonAddundonode()
{
long hObject1;
long hObject2;
//Call the AddUndoNode method to add an undo node to the container.
m_pRasterAnn->AnnAddUndoNode ();
//Disable the undo feature
m_pRasterAnn->PutAnnUndoEnable (FALSE);
//Perform the operations to be combined into one undo.
m_pRasterAnn->AnnCreate(ANN_OBJECT_NOTE, TRUE, TRUE);
hObject1 = m_pRasterAnn->GetAnnObject();
m_pRasterAnn->PutAnnRectLeft(hObject1,0);
m_pRasterAnn->PutAnnRectTop(hObject1,0);
m_pRasterAnn->PutAnnRectWidth(hObject1, 100);
m_pRasterAnn->PutAnnRectHeight(hObject1,100);
m_pRasterAnn->AnnCreate(ANN_OBJECT_NOTE, TRUE, TRUE);
hObject2 = m_pRasterAnn->GetAnnObject();
m_pRasterAnn->PutAnnRectLeft (hObject2,0);
m_pRasterAnn->PutAnnRectTop (hObject2, 100);
m_pRasterAnn->PutAnnRectWidth (hObject2, 100);
m_pRasterAnn->PutAnnRectHeight (hObject2, 100);
//Re-enable the undo feature
m_pRasterAnn->PutAnnUndoEnable(TRUE);
}