[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Visual C++ & Parallel Port

Posted on 1997-12-18
7
Medium Priority
?
558 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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Rules and regulations were devised in order to maintain the integrity of a system. However, interpretation of rules can be quite tricky.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
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, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

830 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