Printing Ascii Characters
Printing Ascii Characters
(OP)
I need to open a Posiflex Cash drawer by sending Ascii Character <07> to the POS printer to which it is connected.
How do I send Ascii Characters to an LPT port?
Thanx
How do I send Ascii Characters to an LPT port?
Thanx
RE: Printing Ascii Characters
I Recommend 2 ya to Write a TextFile the Code, and use the
DOS Command "PRINT LPT1 C:\Open.txt" ;)
If you want something more enlightment:
Just Go and analyze the LinePrint Template (FREE), there is some API's That are Called for writing in LPT ports.
There are Also a Plenty of Funtions in API that does what you're intending:
OpenPrinter
WritePrinter
ClosePrinter
The Recommended for 32bit app is using:
CreateFile
The CreateFile function creates or opens the following objects and returns a handle that can be used to access the object:
· files
· pipes
· mailslots
· communications resources
· disk devices (Windows NT only)
· consoles
· directories (open only)
HANDLE CreateFile(
LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDistribution, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
);
Best Regards
-----
carabez@hotmail.com