#include #include #include "pport.h" using namespace std; static HANDLE ppfd = NULL; void pport_write(unsigned char val) { if (ppfd == NULL) { ppfd = CreateFile("LPT1", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (ppfd == NULL) { cerr << "Couldn't open LPT1!" << endl; exit(4); } } DWORD bytes_written = 0; WriteFile(ppfd, &val, 1, &bytes_written, NULL); }