ShowTemplateDlg example for C++ Builder

int __fastcall TForm1::LEADTwain1SaveCapabilityEvent(
      pTW_CAPABILITY pCapability) 
{
   // Do pre operations on data to save

   return SUCCESS; 
}

void __fastcall TForm1::btnShowTemplateDlgClick(TObject *Sender) 
{
 L_INT nRet; 

 LEADTwain1->EnableSaveCapabilityEvent = true; 
   nRet= LEADTwain1->ShowTemplateDlg ( "c:\\Test.ltt" ); 
   if ( nRet != SUCCESS ) 
   {
      // Error check procedure
   }
}