Guys, I'm having some trouble with some code. IT's supposed to read in from a parallel port, and it's using the io.dll from this site. :down:
To get it to work with another bit of code, it has to be able to compile when you right-click on the text, select "TargetExpert", then in the "Platform" menu select "DOS (Standard). Now check the "BGI" box under "Libraries".
To get it to work with another bit of code, it has to be able to compile when you right-click on the text, select "TargetExpert", then in the "Platform" menu select "DOS (Standard). Now check the "BGI" box under "Libraries".
PHP:
void UnloadIODLL();
int LoadIODLL();
#include "io.h"
#include <stdio.h>
#include <stdlib.h>
PORTWORDIN PortWordIn;
HMODULE hio;
void main(void){
char cont;
int input;
input = LoadIODLL();
if(input == 1)
{
printf("\n\nError: Cannot load library...\n\nProgram ends.");
exit(0);
}
do
{
input = PortWordIn(379);
printf("Port word in is %d", input);
getchar();
printf("\nAnother? (y/n) ");
scanf("%c", &cont);
}while((cont == 'y') || (cont == 'Y'));
UnloadIODLL();
}
void UnloadIODLL() {
FreeLibrary(hio);
}
int LoadIODLL() {
hio = LoadLibrary("io");
if (hio == NULL) return 1;
return 0;
}
