Kim Hansen
April 6th, 1999, 07:29 AM
Hi
In my windows application I need to write some characters to my locale parallel-port.
This is a sample of the source code:
HANDLE hPort;
char szBuffer = "ABCDEF";
int nBytesToWrite;
DWORD dwBytesWritten;
nBytesToWrite = strlen (szBuffer);
hPort = CreateFile("LPT1", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(hPort, szBuffer, nBytesToWrite, &dwBytesWritten, NULL);
CloseHandle(hPort);
Unfortunately the character-string is not printed out immediately. The string is printed out when window is shutting down.
What am I doing wrong?????
Regards,
Kim Hansen
I’m using Visual C++ version 5.0 / MFC.
In my windows application I need to write some characters to my locale parallel-port.
This is a sample of the source code:
HANDLE hPort;
char szBuffer = "ABCDEF";
int nBytesToWrite;
DWORD dwBytesWritten;
nBytesToWrite = strlen (szBuffer);
hPort = CreateFile("LPT1", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(hPort, szBuffer, nBytesToWrite, &dwBytesWritten, NULL);
CloseHandle(hPort);
Unfortunately the character-string is not printed out immediately. The string is printed out when window is shutting down.
What am I doing wrong?????
Regards,
Kim Hansen
I’m using Visual C++ version 5.0 / MFC.