Hammer111
Junior Member level 3
Hi all
I was searching how to program parallel port but I have some errors. I'm using Microsoft Visual C++ 6.0. Here's my code
THIS CODE IS MODIFIED original isn't working either
I was using this site https://electrosofts.com/parallel/index.html and also part 2 on that site which explains how to use inpout32.dll
I copied inpout32.dll in my windows/system folder and in my folder where I saved program and I get this error while trying to run it
Linking...
parallel.obj : error LNK2001: unresolved external symbol "short __stdcall Inp32(short)" (?Inp32@@YGFF@Z)
Debug/parallel.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Also I noiced clrscr() and delay(10) doesn't exist so I deleted that
why did he write /0x08 .../0x10 etc?
I NEED SOME PDF OR SITE WHERE EVERY CODE LINE IS EXPLAINED BECAUSE I'D LIKE TO PROGRAM IT MYSELF.
I was searching how to program parallel port but I have some errors. I'm using Microsoft Visual C++ 6.0. Here's my code
THIS CODE IS MODIFIED original isn't working either
Code:
/* file: ex1.c
by HarshaPerla for electroSofts.com.
Displays contents of status register of parallel port.
Tested with TurboC 3.0 and Borland C 3.1 for DOS.
*/
#include"stdio.h"
#include"conio.h"
#include"dos.h"
short _stdcall Inp32(short portaddr);
void _stdcall Out32(short portaddr, short datum);
#define PORT 0x378
void main()
{
int data;
while(!kbhit())
{
data=Inp32(PORT+1);
printf("Data available in status register: %3d (decimal), %3X (hex)\n", data, data);
printf("\n Pin 15: %d",(data & 0x08)/0x08);
printf("\n Pin 13: %d",(data & 0x10)/0x10);
printf("\n Pin 12: %d",(data & 0x20)/0x20);
printf("\n Pin 11: %d",(data & 0x80)/0x80);
printf("\n Pin 10: %d",(data & 0x40)/0x40);
}
}
I was using this site https://electrosofts.com/parallel/index.html and also part 2 on that site which explains how to use inpout32.dll
I copied inpout32.dll in my windows/system folder and in my folder where I saved program and I get this error while trying to run it
Linking...
parallel.obj : error LNK2001: unresolved external symbol "short __stdcall Inp32(short)" (?Inp32@@YGFF@Z)
Debug/parallel.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Also I noiced clrscr() and delay(10) doesn't exist so I deleted that
why did he write /0x08 .../0x10 etc?
I NEED SOME PDF OR SITE WHERE EVERY CODE LINE IS EXPLAINED BECAUSE I'D LIKE TO PROGRAM IT MYSELF.