Capability Example for Visual Basic
Public iRet As Integer
Public TwainCap As New LEADTwainCapability
Private Sub Test()
Dim RasterTwain As LEADRasterTwain
Dim strName As String
Dim lCount As Long
Dim lCapability As Long
Dim n As Integer
Dim CapVal As New LEADRasterVariant
lCount = RasterTwain.CapsCount
For n = 0 To lCount - 1 Step 1
lCapability = RasterTwain.Capability(n)
' Check for capability and do other processing
If lCapability = L_ICAP_XFERMECH Then
TwainCap.EnableMethodErrors = False
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_FILE
TwainCap.CapOneValue.OneValCapValue = CapVal
iRet = RasterTwain.SetCapability2(TwainCap, L_LTWAIN_CAPABILITY_SET)
End If
Next n
End Sub