Solved

Writing to the parallel port on Win32

Posted on 1998-02-27
2
858 Views
Last Modified: 2013-11-20
I want to to hold a value on the parallel port. In DOS, i just had to "outport" to the lpt address, while in Win32 ( Nt workstation )it is a bit more complecated i guess.
So far i was abble to open the file \.\\lpt for reading and writing ( CreateFile ), but wheneven i try to write, WriteFile failes ( although GetLastError claims that the operation completed successfuly ) and nothing apears on the parralel port.  
Does anybody know how to configure the parallel port ( maybe its a control flow issue? ) - is it done in the same bizzar way like the serial port?  How can i realy complete this simple and rather stupid operation successfuly?
0
Comment
Question by:shaig
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 1316611
Using CreateFile doesn't open the port itself but rather the LPT port driver.  The port driver is designed to run a printer, so it wants something out there that "talks" like a printer.  If you need to do some sort of custom I/O to a port, you need one of two things, a VxD under Win95 and/or a NT Device Driver under NT.
0
 
LVL 3

Author Comment

by:shaig
ID: 1316612
Is there a hardware  workaround, like connecting one of the parallel port pins to another ( similar to 3 pin serial connections - elimination of control flow ).
Sorry,
not realy an inteligent question, but i havne't got the time to explore this issue deeply.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question