Transfer Options Example for C++ 5.0 and later

ILEADRasterTwain_U * pRasterTwain;

HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterTwain_U, NULL, CLSCTX_ALL, IID_ILEADRasterTwain_U, (void **)&pRasterTwain);
if (FAILED(hr) || !pRasterTwain)
{
  ::MessageBox (NULL, _TEXT("Failed to create a Raster Twain Object"), _TEXT("Error"), MB_OK);
  return;
}

pRasterTwain->InitSession((long)GetSafeHwnd()); 
pRasterTwain->SelectSource();
pRasterTwain->GetTransferOptions ();

if (pRasterTwain->IsFileTransferAvailable)
{
	::MessageBox(NULL, TEXT("File transfer is supported"), TEXT("Notice!"), MB_OK);
	//Set File transfer options
	pRasterTwain->put_TransferMode (L_TWAIN_TRANSFER_FILE);
	CString csFileName = TEXT("c:\\test.bmp");
	pRasterTwain->put_TransferFileName (csFileName.AllocSysString());
	pRasterTwain->put_TransferFileFormat (L_TWFF_BMP);
}
if (pRasterTwain->IsMemoryTransferAvailable)
{
	::MessageBox(NULL, TEXT("Memory transfer is supported"), TEXT("Notice!"), MB_OK);
	//Set memory transfer options
	pRasterTwain->put_TransferMode (L_TWAIN_TRANSFER_MEMORY);
	pRasterTwain->put_TransferCompressionType (L_TWCP_NONE);
}
if (pRasterTwain->IsNativeTransferAvailable)
	::MessageBox(NULL, TEXT("Native transfer is supported"), TEXT("Notice!"), MB_OK);
	
pRasterTwain->SetTransferOptions ();