I am creating a POS app. I started with the POS printer and it is working. After that I added the "open cash drawer" functionality. But it interferes with the POS printer somehow.
So what is happening?
When I only claim a POS printer, printing works fine. Also when I only claim a Cash drawer, the drawer opens fine. So no problem there.
But when I claim both (POS printer and drawer) at the same time, the printing gets stuck or freezes. The drawer still opens fine. Most of the time when I claimed both, the first print looks fine, but it doesn't cut the paper. When I print again the program freezes.
Somehow I can not use these two objects at the same time:
OPOSPrinter oposprinter = new OPOSPrinter(); // Has the Windows.Devices.PointOfService.PosPrinter class
OposCashDrawer oposcashdrawer = new OposCashDrawer(); // Has the Windows.Devices.PointOfService.CashDrawer class
When I claimed the ClaimedCashDrawer
then this line gives ClaimedPrinter = await CurrentPrinter.ClaimPrinterAsync();
a null
.
I have a sample project uploaded here: https://github.com/hellyeahniels/TestPrintAndDrawer
Could please someone explain to me what is wrong and how to fix this?
Thanks in advance.