AnnGetNameRestrict example for C++ Builder

//This sample toggles the bNameRestrict property of the annotation object hObject
void TForm1::SampleNameRestrict (L_HANDLE hObject )
{
   BOOL bNameRestrict;
   AnsiString strMsg;

   bNameRestrict= LEADAnn1->AnnGetNameRestrict (hObject);
   bNameRestrict= !bNameRestrict;

   if (bNameRestrict)
      strMsg = "Changing NameRestrict property to TRUE";
   else
      strMsg = "Changing NameRestrict property to FALSE";

   ShowMessage (strMsg);
   LEADAnn1->AnnSetNameRestrict (hObject,  bNameRestrict, FALSE);
}