AnnSetAutoText example for C++ Builder
// This example is also for:
// AnnGetAutoText method,
//This example modifies the text string that is used for the undo option on the annotation pop-up menu.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char * pTestText;
int strSize;
strSize= LEADAnn1->AnnGetAutoText (ANNAUTOTEXT_MENU_UNDO, NULL);
if (strSize > 0)
{
pTestText= (char *) malloc (strSize + 1);
if ( !pTestText )
{
ShowMessage ("NO MEMORY");
return;
}
LEADAnn1->AnnGetAutoText (ANNAUTOTEXT_MENU_UNDO, &pTestText);
StrCat (pTestText, " - New");
LEADAnn1->AnnSetAutoText (ANNAUTOTEXT_MENU_UNDO, pTestText);
free (pTestText);
}
}