Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Visual C++ & Parallel Port

Posted on 1997-12-18
7
Medium Priority
?
557 Views
Last Modified: 2013-11-15
How can the parallel port be written or read(every single pin) using Visual C++(version 4.2 or 5.0)?
0
Comment
Question by:hccao
[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
  • 4
  • 3
7 Comments
 
LVL 3

Accepted Solution

by:
os012897 earned 200 total points
ID: 1176749
Hi hccao,

There are functions to do this, though I do not remember the exact name of them. Search in help for "Comm" or "port" ....

Accessing *every* single pin could be a problem. You can access the 8 different data-pins easily using bit-masks. The other pins are status indicators (e.g. on/offline of a printer). You can access those pins using status-read or write functions. I am not sure whether all pins can be accessed that way though.

Greetings,

            os

0
 
LVL 1

Expert Comment

by:messiah
ID: 1176750
Come on man, if you're gonna answer the question, answer the question. Beating around the bush helps no one.
0
 
LVL 3

Expert Comment

by:os012897
ID: 1176751
I do not think this was beating on the bush ....

This is the principal way how to do it. Nevertheless it is true that the answer is generic, although the question specifically conentrated on a solution for VC++. I do not have the documentation for VC++ available at the moment, which was the reason for the generic way of my answer.

I would recommend hccao to therefore reject my answer in case it did not help. If anybody (messiah?) has the exact solution to the problem, post it.

If noone could answer it till monday, I will look some more info up at work and post it is a comment.

Greetings,
   
                 os

0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 1

Expert Comment

by:messiah
ID: 1176752
The reason why I intervened was not because I could come up with a better answer, but that I could benefit from the answer as I am having the exact same problem.

BTW: I did not mean to offend you or anyone else, just merely stating that the answer wasn't really an answer :)

-messiah
0
 
LVL 3

Expert Comment

by:os012897
ID: 1176753
No offense taken :)

os

0
 
LVL 3

Expert Comment

by:os012897
ID: 1176754
I took a look at my documentation at work and have to say that I wont be able to come up with a proper solution.

As under DOS you can use the int17h to send and retrieve data and status of a printer, (which gave u about 16 pins to read and write) I assumed wrongly that there is a straight forward way to this in Windows too.

The farthest I got were the SetPrinter and GetPrinter functions that let you set and retrieve the status of the printer.Though those will give u access to at most 8 pins of the port in case it somehow corresponds to the behaviour of the DOS-printer status.

With the WritePrinter and ReadPrinter you should be able write and read another 8-bits of the port.

So you could probably get 16 pins working for you, though it is a pretty humble way, in case it works at all.

Hmmm ... a better way would probably be to search for a library that accesses the parallel port bitwise via the printer-device-driver.

I'd put the question back for evaluation, as there might be someone who solved it properly.

Greetings,

        os

0
 
LVL 1

Expert Comment

by:messiah
ID: 1176755
Wow, thanks os.. you got me thinking :)
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Invest in your employees with these five simple steps to improve employee engagement and retention.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

730 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