Please have a look at the following code. Can I release the printer while PosControlException occurs? What will happen if I do that?
Dim posExplorer As New PosExplorer() Dim deviceInfo As DeviceInfo = Nothing deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, PrinterName) pr = posExplorer.CreateInstance(deviceInfo) pr.Open() Try pr.Claim(10000) Catch e As PosControlException Try pr.Release() Catch ex As Exception Throw e End Try Throw e Catch e As Exception .... End TryThanksSunday, February 26, 2012 6:59 AM
If you get an error on a claim in the service object, I would guess the device was never claimed, thus release is redundant. It can't hurt.
www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NETSunday, February 26, 2012 5:31 PMAnswerer
On which error message? Claim or Release?
www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET
Monday, February 27, 2012 5:26 AMAnswerer
- Edited by Sean LimingMVP, Editor Monday, February 27, 2012 5:26 AM