GetCapability example for C++ Builder

void __fastcall TForm1::btnGetCapabilityClick(TObject *Sender) 
{
 L_INT nRet; 
   TW_CAPABILITY twCap; 

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