Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parallel port with VC++

Posted on 1998-06-17
6
Medium Priority
?
545 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 200 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

886 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