CapEnum Example for Visual Basic
Public WithEvents RasterTwain As LEADRasterTwain
Dim TwainCap As LEADTwainCapability
Private Sub Command3_Click()
Dim iRet As Integer
Dim CapVal As New LEADRasterVariant
Set TwainCap = New LEADRasterTwainCapability
TwainCap.CapInfo.ConType = L_TWON_ENUMERATION
TwainCap.CapInfo.Capability = L_ICAP_UNITS
TwainCap.EnableMethodErrors = False
TwainCap.CapEnum.EnumNumOfItems = 2
CapVal.Type = VALUE_USHORT
CapVal.LongValue = L_TWUN_INCHES
TwainCap.CapEnum.EnumCapValue(0) = CapVal
CapVal.Type = VALUE_USHORT
CapVal.LongValue = L_TWUN_TWIPS
TwainCap.CapEnum.EnumCapValue(1) = CapVal
TwainCap.CapEnum.EnumCurrentIndex = 0
TwainCap.CapEnum.EnumDefaultIndex = 0
TwainCap.CapEnum.EnumItemType = L_TWTY_UINT16
iRet = RasterTwain.SetCapability2(TwainCap, L_LTWAIN_CAPABILITY_SET)
If (iRet <> 0) Then
MsgBox "Error Setting Capability"
End If
Set TwainCap = Nothing
End Sub