I'm trying to write application run as service in vb6.
I have two barcode printers (ZEBRA) with print servers connected to centronics port (D-LINK DP-301P+).
In my service i connect to SQL server and get information about destination printer and source code (ZPL) to print.
Now i must send my ZPL code to the printer.
Everything works fine when I save ZPL to file, map TCP to LPT1 and copy/print FILE to this port like this:
net use LPT1: \\22.214.171.124\myport1 copy C:\test1.txt lpt1: /b
objNetwork.AddPrinterConnection("LPT1:", "\\126.96.36.199\myport1", True) ... Open "C:\test1.txt" For Binary As #1 Open "LPT1:" For Binary As #2 ...
But i don't want to SAVE my ZPL code string to FILE,
i want to connect to my Print Server and Send my ZPL CODE to print.
I Need get some STATUS after operation - success or not - because i have to delete my printed label (or not) from SQL Table.
How to send data to print server? (Winsock.SendData ??)
Do i need Ascii to binary conversion or byte array?
How to check Job status?
Can someone help me?