Click here to Skip to main content
15,889,335 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to know the current logon user is Administrator or Limited user? Pin
ErisonWu10-Aug-04 23:03
ErisonWu10-Aug-04 23:03 
Generalfind the current logged on user Pin
Anonymous9-Aug-04 20:13
Anonymous9-Aug-04 20:13 
GeneralRe: find the current logged on user Pin
parths9-Aug-04 20:26
parths9-Aug-04 20:26 
Questionwhat is usual gamma correction value for generic printer? Pin
baboguru9-Aug-04 19:48
baboguru9-Aug-04 19:48 
GeneralParallel Port Question Pin
zahid_ash9-Aug-04 19:44
zahid_ash9-Aug-04 19:44 
GeneralRe: Parallel Port Question Pin
Antti Keskinen9-Aug-04 21:22
Antti Keskinen9-Aug-04 21:22 
GeneralRe: Parallel Port Question Pin
zahid_ash9-Aug-04 21:33
zahid_ash9-Aug-04 21:33 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 0:08
Antti Keskinen10-Aug-04 0:08 
First, point your browser to this location: http://www.logix4u.net/inpout32.htm

In there, download the Inpout32 binaries and sources. From this zipfile, extract the files inpout32.dll and inpout32.lib. Place these into your project directory.

Open up your project, and go to project settings. Link with "inpout32.lib" to gain access to two functions: Inp32 and Out32. You also need the definitions of the functions. They are as follows (add them to the start of the code module where you wish to use them, or create a header file):
extern short _stdcall Inp32(short PortAddress);
extern void _stdcall Out32(short PortAddress, short data);
Now, use the articles' instructions to determine the address of your computer's parellel port. Then use the Inp32 function to read from this address. The returned value is a short integer.

If you need to determine if a certain pin on the port is set to logic-1 (high), use the articles' instructions, or Google for 'binary operations'. The idea is to mask the returned value against a certain value. The result of the mask operation is either TRUE or FALSE, depending if the pin is set or not. There are so many examples of masking operations on the Net that I don't want to repeat them here.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 0:38
zahid_ash10-Aug-04 0:38 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 1:23
Antti Keskinen10-Aug-04 1:23 
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 1:59
zahid_ash10-Aug-04 1:59 
GeneralRe: Parallel Port Question Pin
Antti Keskinen10-Aug-04 2:41
Antti Keskinen10-Aug-04 2:41 
GeneralRe: Parallel Port Question Pin
zahid_ash10-Aug-04 2:15
zahid_ash10-Aug-04 2:15 
GeneralRe: Parallel Port Question Pin
kandyelectrical12-Dec-12 22:50
kandyelectrical12-Dec-12 22:50 
QuestionHow to know security context ? Pin
Amarelia9-Aug-04 19:16
Amarelia9-Aug-04 19:16 
GeneralcreateEventObject fails Pin
yourbuddy779-Aug-04 19:05
yourbuddy779-Aug-04 19:05 
GeneralSTATIC Text Color Problem Pin
Anonymous9-Aug-04 19:03
Anonymous9-Aug-04 19:03 
GeneralRe: STATIC Text Color Problem Pin
Johan Rosengren10-Aug-04 0:42
Johan Rosengren10-Aug-04 0:42 
GeneralRe: STATIC Text Color Problem Pin
Johan Rosengren10-Aug-04 1:23
Johan Rosengren10-Aug-04 1:23 
GeneralVisual C++ Standard Edition Pin
zecodela9-Aug-04 16:22
zecodela9-Aug-04 16:22 
GeneralRe: Visual C++ Standard Edition Pin
Antti Keskinen9-Aug-04 20:47
Antti Keskinen9-Aug-04 20:47 
GeneralC++ global const question Pin
Indrawati9-Aug-04 15:34
Indrawati9-Aug-04 15:34 
GeneralRe: C++ global const question Pin
Jeff Bogan9-Aug-04 17:27
Jeff Bogan9-Aug-04 17:27 
GeneralRe: C++ global const question Pin
Anonymous9-Aug-04 18:40
Anonymous9-Aug-04 18:40 
GeneralRe: C++ global const question Pin
Tim Smith10-Aug-04 3:52
Tim Smith10-Aug-04 3:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.