WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetScannerConfigFile

Sets the scanner configuration file on a WS_FIELD or WS_SCANNER_CONTROLLER widget.

The scanner configuration file can be created using the RFBARCODE object.

Ole declaration

VARIANT_BOOL SetScannerConfigFileByName(LPCTSTR sObjectName, LPCTSTR sFileName);

VARIANT_BOOL SetScannerConfigFileById(SHORT usObjectId, LPCTSTR sFileName);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
sFileName
Name of the scanner configuration file.
Return Value

On success, SetScannerConfigFile returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks
Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
RFBARCODE oBarCode =  new RFBARCODE();
short iFieldId = 33;

oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_FIELD, iFieldId, "", 0,0, 50, 50, "123");
oBarCode.ClearBarcodes ' Clear all barcodes
oBarCode.AddBarcode((short)RFBarcodeConstants.UPC_E0, False, (short)RFBarcodeConstants.DECODEON, 6, 6);
oBarCode.AddBarcode((short)RFBarcodeConstants.UPC_E1, False, (short)RFBarcodeConstants.DECODEON, 10, 10);
oBarCode.AddBarcode((short)RFBarcodeConstants.UPC_A, False, (short)RFBarcodeConstants.DECODEON, 12, 12);
oBarCode.StoreBarcode("ScannerCfg", (short)RFBarcodeConstants.BCDISABLED);
oWidget.SetScannerConfigFileById(iFieldId, "ScannerCfg");
Visual Basic 6 (Full Example: FieldDemoModule.bas.txt)
Public wsWidget As New WStWidget
Public wsRfBarcode As New RFBARCODE
...
wsRfBarcode.AddBarcode CODE_I25, False, DECODEON, 2, 20
wsRfBarcode.AddBarcode CODE_93, False, DECODEON, 2, 14
wsRfBarcode.AddBarcode CODE_128, False, DECODEON, 1, 32
wsRfBarcode.StoreBarcode "FieldDemo", BCDISABLED
...
wsWidget.ModifyInputModeByName "maxLengthField", 0, WS_FIELD_IM_NUMERIC_ONLY
wsWidget.SetMaxLengthByName "maxLengthField", 2
wsWidget.ModifyInputDevicesByName "maxLengthField", 0, WS_FIELD_ID_DISABLE_SCAN
wsWidget.SetScannerConfigFileByName "maxLengthField", "FieldDemo"
...
See also

ModifyInputMode | ModifyDisplayMode | ModifyInputDevices | ModifyLenCtrlMode | SetKeyboardMode | SetMaxLength | GetLastBarcodeType

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference