EndSession Example for Visual Basic

Public Sub TestTwn()
   Set RasterTwain = New LEADRasterTwain
   Dim CapVal As New LEADRasterVariant
   RasterTwain.InitSession hWnd

   TwainCap.CapInfo.Capability = L_ICAP_XFERMECH
   TwainCap.CapInfo.ConType = L_TWON_ONEVALUE
   TwainCap.CapOneValue.OneValItemType = L_TWTY_UINT16
   CapVal.Type = VALUE_USHORT
   CapVal.LongValue = L_TWSX_NATIVE

   TwainCap.CapOneValue.OneValCapValue = CapVal

   RasterTwain.SetCapability2 TwainCap, L_LTWAIN_CAPABILITY_SET

   RasterTwain.Acquire L_LTWAIN_SHOW_USER_INTERFACE
   RasterTwain.EndSession
End Sub