PointOfService and POS Printers

JamieB

Newcomer
Joined
Jan 10, 2006
Messages
5
Location
UK
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?
 
I'm facing the same problem with Star TSP100 POS printer.

Do you have found a solution, because I'm stuck from 2 days with no solution.


Thanks in advance for your help ! ! !
 
Hello,

Did either of you find a solution to this problem? I have this exact same problem with the TSP100 also. And, there is nothing out there that I can find.

Thanks,

Andrew
 
It's a little tricky, but I know how to do it...

There's a couple steps to accomplish it, and it's still not pretty.

1) Load up the VB project
2) Look for the "STAR" icon and highlight that object.
3) Copy that object and paste it onto your form. (You can hide it.)
4) Then you need to assign that icon to a type "AxSMJOPOSPOSPrinterControlObjectLib.AxPOSPrinter"

That will let you use it as OPOS. Conversely... if all you need to do is print... you can use straight serial, though you don't get feedback or health info.

Charles
 
Back
Top