Capability Example for Visual FoxPro 6
#define L_TWON_ONEVALUE 5
#define L_TWSX_FILE 1
#define L_LTWAIN_CAPABILITY_SET 1
#define L_ICAP_XFERMECH 259
#define L_TWTY_UINT16 4
#define VALUE_USHORT 4
CapVal = CreateObject("LEADRasterVariant.LEADRasterVariant.145")
CapVal.Type = VALUE_USHORT
CapVal.LongValue = L_TWSX_FILE
lCount = oRasterTwain.CapsCount
For n = 0 To lCount - 1 Step 1
lCapability = oRasterTwain.Capability(n)
&& Check for capability and do other processing
If lCapability = L_ICAP_XFERMECH Then
oTwainCap.EnableMethodErrors = .F.
oTwainCap.CapInfo.Capability = L_ICAP_XFERMECH
oTwainCap.CapInfo.ConType = L_TWON_ONEVALUE
oTwainCap.CapOneValue.OneValItemType = L_TWTY_UINT16
oTwainCap.CapOneValue.OneValCapValue = CapVal
iRet = oRasterTwain.SetCapability2(oTwainCap, L_LTWAIN_CAPABILITY_SET)
EndIf
Next