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 Service the call to GetDevice(...) always returns null.
explorer = new PosExplorer();
device_info = explorer.GetDevice(DeviceType.PosPrinter, PrinterName);
printer = (PosPrinter)explorer.CreateInstance(device_info);
printer.Open();
printer.Claim(1000);
printer.DeviceEnabled = true;
The printer happens to be an Epson TM-U220B. Is there a security issue that needs to be overcome before a service has access to POS devices? Can anyone recommend a good source of information regarding the development of Windows Services that use OPOS .NET?