AnnSetAutoText Example for C++ 5.0 and later

Note: This topic is for Document/Medical only.

For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

void CTutorDlg::OnButtonAnnsetautotext() 
{
   BSTR bstrText;
   CString strText;
   m_pRasterAnn->AnnGetAutoText(ANN_AUTOTEXT_MENU_UNDO);
   bstrText = m_pRasterAnn->GetAnnAutoText();
   strText = bstrText;
   ::SysFreeString(bstrText);
   strText += TEXT(" - New");
   m_pRasterAnn->AnnSetAutoText(ANN_AUTOTEXT_MENU_UNDO,strText.AllocSysString());
}