I've run this program
Code:
include "stdafx.h"
#include "conio.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
int main(int argc, char* argv[])
{
short data;
if(argc<2)
{
printf("Usage\n\n");
printf("partest1.exe ,,\n\n\n");
return 0;
}
if(!strcmp(argv[1],"read"))
{
data = _inp(atoi(argv[2]));
printf("Data read from parallel port is ");
printf("%d\n\n\n\n",data);
}
if(!strcmp(argv[1],"write"))
{
_outp(atoi(argv[2]),atoi(argv[3]));
printf("Data written to parallel port is ");
printf("%s\n\n\n\n\n",argv[3]);
}
return 0;
}
I did just what danielsmusic instructed,the program was built successfully (i think), and it opened a window, i attached the image of the window below, but as I pressed a key, the window disappeared afterwards, I haven't done the hardware yet, but do you think that it worked?
but when I replaced the _outp(atoi(argv[2]),atoi(argv[3])) by Out32(atoi(argv[2]),atoi(argv[3])), this was the error that occurred:
error C2065: 'Out32' : undeclared identifier
I think I saw someone posted in here that I need to replace _outp() with Out32() if I was to used the inpout32.dll?