Web Development

General discussion


Detecting number and location of paralle

By pjbotti ·
I am looking for a way to detect the number of parallel ports and location (address) of these ports. This solution must work for a Window application running in either Windows 95/98 or Windows NT.

I have successfully used a pointer to the BIOS to detect and communicate over the parallel ports in a DOS based application that runs on both Windows 95/98 or Windows NT. The problem is that this code does not work in a Window based application.

I noticed that Win32 SDK has the command
void GetParallelPortsList(LPSTR szSymbol);
GetParallelPortsList sets the specified symbol to a list of all parallel ports (that is, "LPT1","LPT2",_).
Specifies the name of the symbol to associate with the list.

But it doesn't give very much information on how to use this command and even after getting a list of ports, I still do not know what other command is required to open that port.

Any ideas on how to proceed are appriciated.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Detecting number and location of paralle

by owindels In reply to Detecting number and loca ...

I recently found a program using Windows Management Instrumentation that detects nearly everything on your PC. The source code is available at http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=1&txtCodeId=7066. Maybe it'll help you.

Collapse -

Detecting number and location of paralle

by pjbotti In reply to Detecting number and loca ...

The download looks like a good program to detect system hardware. However, it is written in visual basic, which is a language that I am unfamiliar with, and come with insufficient documentation on how to use it. There is a file path that is incorrect. My preffered languages are ANSI C and C++. If someone knows of an SDK function or library that I could use in a C environment, that would be helpfull.

Related Discussions

Related Forums