locked
Windows 10 - Barcode scanner stays claimed after application crash RRS feed

  • Question

  • One of the issues that I have continuously ran into is that after an unexpected application crash, the barcode scanner will stay claimed which doesn't allow the barcode to be claimed again.

    This behavior only occurs in Windows 10 environments and does not occur in Windows 7. A reboot of the computer is the only thing that brings it back to where the barcode scanner can be claimed.
    NOTE: This does not occur with any other of my OPOS devices (cash drawer, receipt printer, coin dispenser, etc).

    I found this thread: https://social.msdn.microsoft.com/Forums/vstudio/en-US/b2ba5ccf-a57a-45dd-b822-9df74beed1fb/still-claimed-after-crash?forum=posfordotnet

    What can I do to resolve this issue and make certain that after an application crash the barcode scanner is released and is functional again upon relaunch?


    Monday, August 27, 2018 4:39 PM

Answers

  • Hi appSupportAnalyst,

    In my first years as a programmer, I too have worked with opos drivers. I recall they were a headache to work with. From my experience, when they produce weird errors, sometimes there is not much you can do, you are at the mercy of the OPOS driver author. Here are some note:

    1. You could try checking the windows event log to find issues with them since the OPOS drivers use COM+ components (native) so a lot of the exceptions will not reach .net with a clear message.
    2. Make sure you are using the latest version of Microsoft Point of Service for .NET 
    3. Make sure you are using the latest OPOS driver from the manufacturer.
    4. Try uninstalling the OPOS drivers, clearing the registry
      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OLEforRetail\ServiceOPOS] (x64)
      [HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS] (x32)
      and then installing the OPOS drivers again. You have no idea how many times this has saved me.
    5. If nothing works, report the issue to the manufacturer so that they can update the driver/firmware of the device.

    I am sorry, I don't have access to the codebase I used to work. I probably faced the same issue and I don't remember the solution (which may be different per OPOS driver implementation). Did you try having a recovery logic when the claim fails? Maybe Opening and Closing the device will release the Claim ?


    Wednesday, August 29, 2018 10:55 AM

All replies

  • Hi appSupportAnalyst,

    Thank you for posting here.

    For your question, what is your POS software? How do you connect your POS and Win10? Have you use the API which you get from supplier? Have you use the latest version? The software who provided, have you check with them that the application works well in Win10?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 28, 2018 6:35 AM
  • The POS application was designed using C# running on Windows 10 64-bit.

    When there is a crash of our application, the device is not released. When the user relaunches the POS software, the barcode scanner is unable to be claimed since it didn't get released upon initial application crash. Rebooting the whole computer bring the barcode scanner back to a functional state.

    Tuesday, August 28, 2018 5:08 PM
  • Hi appSupportAnalyst,

    According to your feedback, all the error caused by the device is not released when the crash happened.

    Does the API which you used to connect to the POS device has the method to release the device? If yes, use a try catch finally to catch the exception and then release the device.

    try { //the code which caused the error

    } catch { //catch the exception

    } finally { //release the device and close the application

    }


    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 29, 2018 7:59 AM
  • Hi appSupportAnalyst,

    In my first years as a programmer, I too have worked with opos drivers. I recall they were a headache to work with. From my experience, when they produce weird errors, sometimes there is not much you can do, you are at the mercy of the OPOS driver author. Here are some note:

    1. You could try checking the windows event log to find issues with them since the OPOS drivers use COM+ components (native) so a lot of the exceptions will not reach .net with a clear message.
    2. Make sure you are using the latest version of Microsoft Point of Service for .NET 
    3. Make sure you are using the latest OPOS driver from the manufacturer.
    4. Try uninstalling the OPOS drivers, clearing the registry
      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OLEforRetail\ServiceOPOS] (x64)
      [HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS] (x32)
      and then installing the OPOS drivers again. You have no idea how many times this has saved me.
    5. If nothing works, report the issue to the manufacturer so that they can update the driver/firmware of the device.

    I am sorry, I don't have access to the codebase I used to work. I probably faced the same issue and I don't remember the solution (which may be different per OPOS driver implementation). Did you try having a recovery logic when the claim fails? Maybe Opening and Closing the device will release the Claim ?


    Wednesday, August 29, 2018 10:55 AM
  • Stavros,

    Thanks for the response.

    I believe this is something that will have to be addressed with a conversation to the manufacturer of the device as this behavior isn't exhibited in our Windows 7 environments. I'm also further looking into implementing  a "cleanup" of any possible claimed devices upon application launch and release them, however, I'm uncertain if this will be possible if the claim is coming from another thread.

    Saturday, September 1, 2018 3:49 PM