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

拟墨画扇 提交于 2019-11-30 16:39:48

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!