If you mentioned about DOS I'll give you first a solution
that comes from Pascal.
You should open the paralel port as a text file and then you can send text to
it.
The code looks like this :
AssignFile(TextDevice, 'Lpt1:');
Rewrite(TextDevice);
Then send data to textdevice using the command
Write(TextDevice, ... data ...);
At the end close the file using CloseFile(TextDevice);
It's very simple but it's a little anoying because, first of all, you should
capture the LPT port.
The easiest solution (that I often use) is to send a command line to
command.com (for '95 platform) or cmd.exe(for NT platform).
The Delphi code looks like this (SLPT is the name of the printer) :
ShellExecute(Application.Handle,
'open', PChar('cmd.exe'), PChar(SLPT), 'c:\', SW_SHOWMINNOACTIVE);
Gabriel
--
WinMENTOR Team (http://www.winmentor.ro)
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk