Solved

Parallel port with VC++

Posted on 1998-06-17
6
531 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
Comment Utility
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
Comment Utility
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
Comment Utility

 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mguedes
Comment Utility
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
Comment Utility
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
Comment Utility
it´s wonderfull, thanx trestan
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now