GetNumericContainerFRAMEValue example for C++ Builder

void __fastcall TForm1::btnGetNumericContainerFRAMEValueClick(TObject *Sender) 
{
   L_INT nRet; 
   L_INT nItemType; 
   TW_FRAME twFrame; 
   TW_CAPABILITY twCap; 

   // Fill the TW_CAPABILITY structure with values
   twCap.Cap= ICAP_FRAMES; 
   twCap.ConType= TWON_ONEVALUE; 
   nRet= LEADTwain1->GetCapability ( &twCap, LTWAIN_CAPABILITY_GETCURRENT ); 
   if ( nRet != SUCCESS ) 
   {
      MessageBox ( Handle, "Failed to get capability", "ERROR", MB_OK ); 
      return; 
   }

   nRet= LEADTwain1->GetNumericContainerItemType ( &twCap, &nItemType ); 
   if ( nRet != SUCCESS ) 
   {
      MessageBox ( Handle, "Failed to get capability item type", "ERROR", MB_OK ); 
   }
   else
   {
    if ( nItemType == TWTY_FRAME ) 
    {
       nRet= LEADTwain1->GetNumericContainerFRAMEValue ( &twCap, 0, &twFrame ); 
       if ( nRet != SUCCESS ) 
          MessageBox ( Handle, "Failed to get capability item value", "ERROR", MB_OK ); 
    }
   }
}