I am involved in writing a Point of Sale application, in C# on XP, and need to print to a POS printer. The printer is a Star Micronics TSP643 with USB interface; I have installed Microsoft.PointOfService and the relevant printer driver from Star's download page.
My question is - more or less - Where do I start?
My assumption was that my app would use MS PointOfService, which in turn would connect to the printer driver. The MS PointOfService SDK includes a sample program which demostrates connecting to printers, scanners, card readers, etc. When I run it, my printer shows up in the PosPrinter tree; however, if I select it then click the 'Open' button I get the following exception:
POSControlException ErrorCode(Failure) ExtendedErrorCode(0) occurred: Method Open threw an exception. The device cannot perform the requested procedure.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethod(String methodName, Object[]& parameters, Boolean[] byRef)
System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Opening device: TSP643U
Creating device: TSP643U
I got the same when I ran the sample code downloaded from Star's website (after translating it from VB). I don't really know what is the cause of the exception. The printer shows up in Device Manager and the Star OPOS POSPrinter Register program has no problem in printing a test page. The documentation from Star is lamentable, by the way.
Can anyone shed some light on this please?
My question is - more or less - Where do I start?
My assumption was that my app would use MS PointOfService, which in turn would connect to the printer driver. The MS PointOfService SDK includes a sample program which demostrates connecting to printers, scanners, card readers, etc. When I run it, my printer shows up in the PosPrinter tree; however, if I select it then click the 'Open' button I get the following exception:
POSControlException ErrorCode(Failure) ExtendedErrorCode(0) occurred: Method Open threw an exception. The device cannot perform the requested procedure.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.PointOfService.Legacy.LegacyProxy.InvokeMethod(String methodName, Object[]& parameters, Boolean[] byRef)
System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Opening device: TSP643U
Creating device: TSP643U
I got the same when I ran the sample code downloaded from Star's website (after translating it from VB). I don't really know what is the cause of the exception. The printer shows up in Device Manager and the Star OPOS POSPrinter Register program has no problem in printing a test page. The documentation from Star is lamentable, by the way.
Can anyone shed some light on this please?