Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need to change from printing to lpt1 to USB printer...

113 views
Skip to first unread message

Steve

unread,
Aug 2, 2007, 11:35:12 AM8/2/07
to
Hi all,

I have what would appear to be a common question, but for the life of
me I can't find any answer other than net use which will not work for
me in my case. We're using PB 10.

What we have is an app that prints shipping labels to (strangely
enough) a label printer using the printer's own language. In this
case it's a Zebra printer so it's...ZCode or something like that.
When a user first connects the printer, they don't set up any drivers
but they do a 'setup' in the app which basically sends a set of format
commands down to the printer.

When a user prints labels (or even the format commands) what we do in
code is create a text file in our app directory and simply append to
it for each label we are creating. When done, we run a DOS command to
force the file out the lpt1 port: TYPE x.dat > LPT1

My problem is, the client is getting new laptops which do not have
parallel ports.

I've managed to get the net use option working, but that requires a
specific setup on the client machine and not all the users have admin
privleges (or in some cases no privs at all but the very basics) so
it's not an option for me.

I've tried the following:
printgetprinters() to get the printer name & port then....

i_result=printsetprinter('Zebra Z6M (200dpi) winspool Ne00:')
l_file = fileopen('c:\temp\ait2.dat')
filereadex(l_file, s_test)
fileclose(l_file)
l_print = printopen('Print MSL Data')
i_result=printsend(l_print, s_test, 124)
i_result=printclose(l_print)

And what came out the printer was a very damaged version of the
label. In the help it says printsend catches zeros as terminators so
I've updated my file with pipes instead which is ASCII 124.

It seems the data is still getting mangled on the way over so I'm at a
loss at this point.

Anyone have some suggestions?

Thanks in advance.


dawnbr...@teamsybase.com

unread,
Aug 2, 2007, 3:51:36 PM8/2/07
to
I found an article:

Connecting an MS-Dos Application to a Printer on a USB Port
on Windows 2000

http://www.decompile.com/dataflex/tips/usb_printer.htm

Steve

unread,
Aug 3, 2007, 7:53:02 AM8/3/07
to
Thanks Dawn,

Unfortunately that's using net use. The client computers are essentially
locked down which is why we were printing direct in the first place since
they cannot add printers after the fact.

What I need is something that will literally take a file byte for byte and
just push it at a USB printer, bypassing all drivers so the printer deals
with the command codes embedded in the file itself. Everything I've tried
so far has gotten mangled on the way over to the printer.

<dawnbr...@teamsybase.com> wrote in message
news:46b235c8.23d...@sybase.com...

Steve

unread,
Aug 3, 2007, 8:40:46 AM8/3/07
to
I should clarify, in this new case with a USB printer, I believe they will
need to have someone install it for them in certain cases. I'm not 100%
sure that net use will be allowed or if the people doing the configuration
are trustworthy to get it right.

The less I need the users/admins to do the better.

"Steve" <nob...@home.com> wrote in message news:46b3171e$1@forums-1-dub...

graemecooke

unread,
Aug 3, 2007, 10:37:04 AM8/3/07
to
Hi Steve

Not sure if this is of any use but some time ago I had to
print to a networked intermec printer. What I did was to
print to a Windows text printer drive that refernced the
relevant network port. This could have easily been the USB
instead.

To get around the text drive butchering my crafted printer
commands I used something called PrintDirect. It was cheap
and royalty free to distribute. See the following site for
details:

http://www.direct-print.com/PrintDirect dll.htm

Hope this helps.

Regards
Graeme

Jason 'Bug' Fenter [TeamSybase]

unread,
Aug 3, 2007, 3:05:17 PM8/3/07
to
I have also heard of accessing USB ports as if they were COM ports. I
have no details for you, but it might be something you can research on
the web. FWIW, I've pushed ZPL to Zebra printers over a true COM port
several times.

Steve

unread,
Aug 7, 2007, 12:35:54 PM8/7/07
to
Graeme,

I gave the print direct app a try with success!

What I need to do now is interface with their dll for testing. I have one
of our guys also trying to create a direct dll of our own now that we've
seen this work.

Did you need to wrap the dll for PB or is it already PB friendly?

Thanks

<Graeme Cooke> wrote in message news:46b33d90.3f0...@sybase.com...

0 new messages