AnnAutomation Property 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 shows how you can use the AnnAutomation property to 
//access the automation object through API functions.
//You must link to the ltann_n.lib import lib 
#include "e:\\lead14\\dll\\include\\l_bitmap.h"
void CTutorDlg::OnButtonAnnautomation() 
{
   int nRet;
   unsigned int bIsBold; /* Is the object's text bold */
   HANDLE hAnnObject;
   hAnnObject = (HANDLE)m_pRasterAnn->GetAnnAutomation();
   
   //Toggle the default font bold property
   L_AnnGetFontBold(hAnnObject, &bIsBold);
   if (bIsBold)
      AfxMessageBox(TEXT("Removing bold"));
   else
      AfxMessageBox(TEXT("Making bold"));
   
   nRet = L_AnnSetFontBold(hAnnObject,  !bIsBold, 0);
   if (nRet != SUCCESS) 
   {
      AfxMessageBox(TEXT("L_AnnSetFontBold failed"));
   }
}