Solved

Parallel port with VC++

Posted on 1998-06-17
6
534 Views
Last Modified: 2013-11-20
I want to test a pin of the parallel port to use it like a trigger. anyone help´s me?

mguedes
0
Comment
Question by:mguedes
6 Comments
 
LVL 3

Expert Comment

by:shaig
ID: 1318111
Yes. i've done just that.
Are you using NT or 95??
for NT:
The standard parallel device driver does NOT support such actions, only printer commands. i'm sorry to be the one to bring the bad news, but for doing that you should write a specific device driver. the ddk has some misrable examples, but there are some products out there that can make the job an easy one. look into WinDK and WinRT products for more details.
for 95:
There is realy no problem. you can access hardware like in dos, (this case outport to the parallel port address) only remmember that this code wont be compatible with NT.
0
 

Author Comment

by:mguedes
ID: 1318112
thanx shaig for your answer, but i have one more question. What´s the roll of the 32bits WINAPI´s CreateFile, ReadFile, SetCommMask, WaitCommEvent, etc..(serial? parallel?)

0
 
LVL 32

Expert Comment

by:jhance
ID: 1318113

 
You CAN use the CreateFile/ReadFile etc to read chars from the serial and parallel ports.  But you CAN'T use them to do "generic" input from the ports.  By generic, I mean that you want to have your own device on the port and read input from it.  If that is the case, then the device must "act" like a printer or terminal/modem.

For example, on the printer port, the device must handshake the control lines lika a parallel printer or the IO routine will not "talk". On the serial port, the serial control lines must all be set right and the character must be clocked in serially with the right "framing".  Otherwise you get an error on the port.

Maybe if you were more specific about the EXACT nature of what you have on the parallel port would be helpful.
 

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:mguedes
ID: 1318114
I´m understand your answer...my idea was to simply use one switch(1L to 0L) to interact like a mouse click, but now i sea that not possible...i have to control more parallel port pin´s to make my switch to work. Do you have some good reference for parallel port pin´s configurations? i apreciate that and thinx for your answer
0
 
LVL 8

Accepted Solution

by:
trestan earned 50 total points
ID: 1318115
There is a software package for access parallel and serious port written in VC++:

http://dialspace.dial.pipex.com/town/close/ec63/portio95.htm
0
 

Author Comment

by:mguedes
ID: 1318116
it´s wonderfull, thanx trestan
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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