Acquire Example for C++ 5.0 and later

short iRet; 
long lSize;
ILEADRasterTwain_U *pltRasTwain; 
CoCreateInstance(
               CLSID_LEADRasterTwain_U, 
               NULL, 
               CLSCTX_ALL, 
               IID_ILEADRasterTwain_U, 
               (void**)&pltRasTwain);
pltRasTwain->InitSession ((long)GetSafeHwnd());
pltRasTwain->SelectSource();
pltRasTwain->GetProperties();
pltRasTwain->DataTransfer->TransferMode = L_TWSX_FILE;
pltRasTwain->DataTransfer->ScanFileFormat = L_TWFF_JFIF;
pltRasTwain->FileTransferName = "c:\\test.jpg";
pltRasTwain->get_MemBufSize(&lSize); 
pltRasTwain->SetProperties();
iRet = pltRasTwain-> Acquire(L_LTWAIN_SHOW_USER_INTERFACE);
if (iRet != 0) 
   MessageBox (TEXT("Error Acquiring From Source"));