Can ANYONE please tell me how to write code which determines which printer port is the actual port? I have read every message on here about the ports and all of the links....but I still can't get my code to work...
I got that code from a website...but it won't work either..Visual C++ says "Far" is an obsolete keyword...and Borland just won't compile it...anyone?
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
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);
printf("Address assigned to LPT%d is %Xh\n",a+1,address);