never tested this, but could help? (you can read more on CreateFile on msdn)
HANDLE ReadWriteHandle = CreateFile ( TEXT ( "LPT1" ), // file/device path name
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
(LPSECURITY_ATTRIBUTES)NULL, OPEN_EXISTING, 0, NULL);
and read/write to it, try it, you won't lose anything =p
also - from the link you posted:
#include <stdio.h>
#include <dos.h>
void main(void)
{
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
int a;
ptraddr=(unsigned int far *)0x00000408;
for (a = 0; a < 3; a++)
{
address = *ptraddr;
if (address == 0)
printf("No port found for LPT%d \n",a+1);
else
printf("Address assigned to LPT%d is %Xh\n",a+1,address);
*ptraddr++;
}
}
so you can find out where your device is, then pass this to CreateFile, again, not tested, i used CreateFile to interface with USB devices(HID) using WinDDK, got some results, but not as expected, info was very rare and unclear, i gave up early because the hardware i had was damaged =p
anyways, i don't even know how the parallel port looks like, and also - don't randomly change the code above because writing on wrong address may damage your computer in some way
EDIT: ok so after some googling it looks like the LPT1 starts at x and ends at y addresses, and y - x = 3, and the pin assignments are for 3 bytes, perhaps, you could directly read/write on those locations? i shall test this on an old, broken PC, or i can use the schools computer
i'm really interested in this, if anyone could provide info/code it would be great :3