operate parallel port

C

Charles Wang

I can not create handle of parallel port while using createfile("LPT1:").
The handle always return -1.

Does CreateFile could open parallel port? I notice PB's help mentions that
CreateFile could creates, opens, or truncates a file, COM port, device,
service, or console. My puzzle is that the device include parallel port?

I can operate COM1 or COM2 in the same way. The LPT1, COM1 and COM2 are all
contained in my device's registry. And I think my hardware has no problem.

Thanks for your help!
Charles Wang
 
P

Paul G. Tobey [eMVP]

If there is a parallel port device on the board and if the driver is
installed correctly, either the port is non-functional and the driver is not
loading as a result, or some other process has the port open. Follow the
instructions in the C help for CreateFile to get the error code associated
with the failure; it will tell you what the problem is.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top