Solved

Writing to the parallel port on Win32

Posted on 1998-02-27
2
860 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 516
Process filename extension 3 208
canBalance challenge 34 104
Problem to App source 6 92
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

756 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