Hi there,
i'm doing some testing with a Socket 3E series SDIO scanner card on a
windows mobile device, all works fine and i can catch the eventhandler on a
good scan, but when i click scan, and during the time its scanning, if i
click the scan button again, it crashes with an exception.
For now, i'm just using try/catch, but it'd be better to be able to catch
some kind of "end scan" event so i can disable my "scan button", then
re-enable it when the scanner is ready.
Any ideas? As far as i can see there is no property/event here for this.
thanks,
Paul
Ryan - 20 Mar 2007 09:32 GMT
Hi Paul,
I've never used the OpenNetCF.Barcode class but I used to use the Socket
SDK for barcoding. What I used to do was have a class visible boolean to
indicate when the button had been press and then cleared this down in
the scan result event. i.e.
void btnScan_OnClick(object sender, EventArgs e){
// Check to see if the scanner is active
if(!ScanningInProgress){
// If not set the flag to prevent a double trigger & GPF
ScanningInProgress = true;
// Trigger barcode scanner
}
}
private void socketScanner_Event(ScannerEventArgs args) {
// Process scanner event (Remove, Insert, Valid Data etc.)
// Clear ScanningInProgress
ScanningInProgress = false;
}
I hope this is of some help.
Ryan
Milsnips - 20 Mar 2007 10:03 GMT
Hey Ryan,
Thanks for the info, unfortunately the Socket SDK doesnt come free, and i'm
only building some small project which i cant afford to go out and buy the
SDK.
In regards to the OpenNetCF,.Barcode class, there is only 2 event handlers
(Disposed and OnDataRecieved) which the second only fires when there is a
successful scan read. other than that the barcode scanner just scans for a
few seconds then turns off and no event is raised.
thanks again,
Paul
> Hi Paul,
>
[quoted text clipped - 20 lines]
> I hope this is of some help.
> Ryan