|
-
April 6th, 1999, 07:29 AM
#1
Problems in writing to LPT-port
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.
-
April 6th, 1999, 07:51 AM
#2
Re: Problems in writing to LPT-port
i am also facing a pretty similar problem.
when i run my executable on wi n 95, it is able to access the serial port.
but when i run it onto win NT, it can't access the serial port..
i tried to run the program from the administrator's account also , but it failed again....
if you have any answers to this one , please mail me at [email protected]
-
April 27th, 1999, 12:43 PM
#3
Re: Problems in writing to LPT-port
Dear Kim,
I am trying to communicate with parallel port too, but I need you to tell me how it works. Can you send me more source code? Help me if you can and you will have a new friend in France!
My email: [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|