OPOS PosExplorer.GetDevice() returns null when executed in Windows Service

后端 未结 2 1505
遥遥无期
遥遥无期 2021-01-03 15:26

The code snippet below makes use of OPOS .NET to open a POS printer for printing. It works fine when executed as part of a standalone application. When executed by a Windows

相关标签:
2条回答
  • 2021-01-03 15:50

    Your code looks good. I see the variable name PrinterName. This variable should contain the Logical Name assigned to the printer. The Logical Name assignment is a seperate step that may be overlooked. You can confirm the proper existance of the Logical Name using POSDM available from the POS for .Net SDK. The command path would be

    C:\Program Files\Microsoft Point Of Service\POSDM LISTNAMES

    If the device and assigned Logical Name do not appear then that would explain your current situation.

    0 讨论(0)
  • 2021-01-03 16:04

    Ah OPOS, it's been a while ... ;)

    It sounds like security. The way to test if it is: 1. Run the service under a user account that you know works from the standalone app 2. Check the setting in the service configuration that allows it to interact with the desktop.

    0 讨论(0)
提交回复
热议问题