PtwInfo Example for Visual FoxPro 6
For details about implementing events, see the tutorial Acquiring an Image.
#define L_TWEI_BARCODETEXT 4610
#define L_TWTY_UINT32 5
#define L_TWCC_SUCCESS 0
PROCEDURE AcquirePageEvent(pBitmap)
&& This sample code is for the AcquirePageEvent handler
&& For another example, refer to the tutorials
twExt = CreateObject("twExtImageInfo.twExtImageInfo.145")
twExt.NumOfInfos = 1
twExt.ptwInfo(0).InfoID = L_TWEI_BARCODETEXT
twExt.ptwInfo(0).ItemType = L_TWTY_UINT32
nRet = RasTwain.GetExtImageInfo(twExt)
If nRet = 0 Then
If twExt.ptwInfo(0).CondCode = L_TWCC_SUCCESS Then
For n = 0 To twExt.ptwInfo(0).NumOfItems - 1 Step 1
Item = twExt.ptwInfo(0).Item(n, 0)
&& Do more processing on the item value
Next
EndIf
EndIf
ENDPROC