Solved

Parallel port with VC++

Posted on 1998-06-17
6
535 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
[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
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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