Computing.Net > Forums > Programming > programming the parallel port

programming the parallel port

Reply to Message Icon

Original Message
Name: Benny
Date: April 11, 2003 at 04:33:22 Pacific
Subject: programming the parallel port
OS: xp pro
CPU/Ram: 2GHZ 256 MB
Comment:

Is it possible to program the parallel port with VC++ under windows XP ?


Report Offensive Message For Removal


Response Number 1
Name: egkenny
Date: April 11, 2003 at 08:20:24 Pacific
Reply: (edit)

WinIo - This library allows direct I/O port access...can be used from non-administrative accounts under Windows NT/2000 and XP.
http://www.internals.com/

You can call the routines in the file winio.dll from C++. You need the following files:
winio.h - (see below) include in your source program
winio.lib - link to this
winio.dll - copy to same directory as your executable
winio.sys - copy to same directory as your executable

Here is the "winio.h" file I use with Visual C++ 6.0:
#ifndef  __WINIO_C_H__
#define  __WINIO_C_H__

_declspec(dllimport) bool _stdcall InitializeWinIo();
_declspec(dllimport) void _stdcall ShutdownWinIo();

extern "C"
{
  _declspec(dllimport) unsigned char * _stdcall MapPhysToLin(unsigned char * pbPhysAddr, 
      DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle);
  _declspec(dllimport) bool _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal);
  _declspec(dllimport) bool _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal);
  _declspec(dllimport) bool _stdcall GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize);
  _declspec(dllimport) bool _stdcall SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize);
}

#endif //__WINIO_C_H__



Report Offensive Follow Up For Removal

Response Number 2
Name: Benny
Date: April 11, 2003 at 09:39:35 Pacific
Reply: (edit)

Can you send me those files to my e-mail:
bennyzamir@walla.co.il

and explain me where to copy them.



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: programming the parallel port 

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge