Solved

Parallel Port Address/Driver :-?

Posted on 1998-06-04
3
268 Views
Last Modified: 2013-11-20
win95/msvc++: i need to know the lpt address (for example 378), ppl tell me i need to write a parallel port driver, i dont have a clue how to do this, is there another way to know the address, if now plz give me full detail how to write this driver.
10x
0
Comment
Question by:talsp
[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
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1316006
Knowing the address will not help you as you cannot directly access an IO port in a Win32 program.. The IO space is protected and can only be accessed in a VxD or regular device driver.
0
 

Author Comment

by:talsp
ID: 1316007
so how can i access vxd or device driver?
0
 
LVL 2

Accepted Solution

by:
jstolan earned 50 total points
ID: 1316008
You need to use the CreateFile function to open a handle to the parallel port.  You can then use the handle to write (and read for bidirectional ports) just like any other file I/O.

Here is a quote from part of the CrateFile help topic:

"The CreateFile function can create a handle to a communications resource, such as the serial port COM1. For communications resources, the dwCreationDistribution parameter must be OPEN_EXISTING, and the hTemplate parameter must be NULL. Read, write, or read-write access can be specified, and the handle can be opened for overlapped I/O. For more information about communications, see Communications"

Note that although it specifically mentions COM1, this also applies to LPT1 etc.  This is a tricky topic.  Good luck.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 112
Macro to save highlighted rows as a separate file 5 46
Smart Camera scanning and reading information 3 122
Sed question 2 124
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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