|
|
|
line printer Line Printer output on Windows NT/2000
|
|
|
A program started its history as written in C for MS-DOS. It calculate something, then as a main output, writes the information on line printer on LTP1: port. Sometimes 10 lines in a minute, sometimes 1 line in hours... (1) DOS version of program just wrote the ASCII characters to LPT1: port and it worked normally. (2) we had to upgrade it to Win 3.1 platform, which discouraged the direct access to the printer, but the SDK gave PASSTHROUGH option to bypass the print manager like: HDC hdcPr; struct lineout_s { int n; char line[LINLEN+1]; } lineout; lll.n = 1; // one line strcpy(lll.line, a string ); hdcPr =CreateDC (lpPrDrv, lpPrDev, LPT1: , (LPSTR) NULL); Escape (hdcPr, PASSTHROUGH, NULL, (LPCSTR)&lineout, NULL); (3) Win32 SDK stopped supporting PASSTHROUGH option, then there was a way to write directly to the port like: HANDLE file; BOOL bWrite; DWORD written; OVERLAPPED o; char string[LINELEN+1]; file = CreateFile( LPT1: , GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,NULL); ... bWrite = WriteFile(file, string, strlen(sting), &written, &o); and it worked with Windows 95 and windows 98. Now, with Windows NT and with Windows 2000 doesn't do anything with this WriteFile() function. Now the client is upgrading to Windows 2000, we need to find the method to print one line on the line printer, without going through print manager (which would try to print a page at once.) Did anyone have the same or similar problem? Did you already find the solution? Any suggestion appreciated. Thanks in advance. muchan <
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
line printer Line Printer output on Windows NT/2000
|
|
|
Any suggestion appreciated. Thanks in advance. muchan <
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
line printer Line Printer output on Windows NT/2000
|
|
|
It calculate something, then as a main output, writes the information on line printer on LTP1: port. Sometimes 10 lines in a minute, sometimes 1 line in hours... (1) DOS version of program just wrote the ASCII characters to LPT1: port and it worked normally. (2) we had to upgrade it to Win 3.1 platform, which discouraged the direct access to the printer, but the SDK gave PASSTHROUGH option to bypass the print manager like: HDC hdcPr; struct lineout_s { int n; char line[LINLEN+1]; } lineout; lll.n = 1; // one line strcpy(lll.line, a string ); hdcPr =CreateDC (lpPrDrv, lpPrDev, LPT1: , (LPSTR) NULL); Escape (hdcPr, PASSTHROUGH, NULL, (LPCSTR)&lineout, NULL); (3) Win32 SDK stopped supporting PASSTHROUGH option, then there was a way to write directly to the port like: HANDLE file; BOOL bWrite; DWORD written; OVERLAPPED o; char string[LINELEN+1]; file = CreateFile( LPT1: , GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,NULL); ... bWrite = WriteFile(file, string, strlen(sting), &written, &o); and it worked with Windows 95 and windows 98. Now, with Windows NT and with Windows 2000 doesn't do anything with this WriteFile() function. Now the client is upgrading to Windows 2000, we need to find the method to print one line on the line printer, without going through print manager (which would try to print a page at once.) Did anyone have the same or similar problem? Did you already find the solution? Any suggestion appreciated. Thanks in advance. muchan <
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
line printer Line Printer output on Windows NT/2000
|
|
|
Have you tried *not* defining a Windows printer to use that particular port? IMHO you can write directly to LPTx: *if* no printer driver has been installed for the corresponding port. Try removing the printer driver, and see what happens... Luc muchan <
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
wrote in message A program started its history as written in C for MS-DOS. It calculate something, then as a main output, writes the information on line printer on LTP1: port. Sometimes 10 lines in a minute, sometimes 1 line in hours... (1) DOS version of program just wrote the ASCII characters to LPT1: port and it worked normally. (2) we had to upgrade it to Win 3.1 platform, which discouraged the direct access to the printer, but the SDK gave PASSTHROUGH option to bypass the print manager like: HDC hdcPr; struct lineout_s { int n; char line[LINLEN+1]; } lineout; lll.n = 1; // one line strcpy(lll.line, a string ); hdcPr =CreateDC (lpPrDrv, lpPrDev, LPT1: , (LPSTR) NULL); Escape (hdcPr, PASSTHROUGH, NULL, (LPCSTR)&lineout, NULL); (3) Win32 SDK stopped supporting PASSTHROUGH option, then there was a way to write directly to the port like: HANDLE file; BOOL bWrite; DWORD written; OVERLAPPED o; char string[LINELEN+1]; file = CreateFile( LPT1: , GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,NULL); ... bWrite = WriteFile(file, string, strlen(sting), &written, &o); and it worked with Windows 95 and windows 98. Now, with Windows NT and with Windows 2000 doesn't do anything with this WriteFile() function. Now the client is upgrading to Windows 2000, we need to find the method to print one line on the line printer, without going through print manager (which would try to print a page at once.) Did anyone have the same or similar problem? Did you already find the solution? Any suggestion appreciated. Thanks in advance. muchan <
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
line printer Line Printer output on Windows NT/2000
|
|
|
Well... it worked. Simple test was FILE *fp; fp = fopen( LPT1: , w ); if (fp != NULL) fprintf(fp, testn ); } fclose(fp); It printed the line! unbelievable.... Elementary, my dear Watson ;^) Luc
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|