GhostScript 8.57 for DOS (V0.00) available ! (DOSX)
Hello Japheth
> > Look at http://www.milec.com/download/GSWC_DLL.ZIP
>
> Thanks! How has your printer problem finally been solved?
It was necessary to specify 'raw' mode access for **device** 'lpt1' just after the opening of **file** 'lpt1'. Here is the source (Microsoft Visual C++ ToolKit 2003):
Test3:
#ifdef MILEC_DEBUG
eprintf("Test n°3...\n");
#endif
/* open 'LPT1' avec option 'OPEN_EXISTING' ('CREATE_ALWAYS' fonctionne aussi) */
PPrinter = CreateFile("LPT1", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (PPrinter == INVALID_HANDLE_VALUE) {
eprintf("Ouverture de 'LPT1' impossible !\n");
free(buffer);
fclose(f);
return FALSE;
}
if (Win_Mode) goto copy3;
/* 170707: Mettre en place le mode 'RAW' */
_asm
{
push ebx
push edx
mov ebx, PPrinter ; PPrinter est un HANDLE sur 32 bits. CF 'CopyFile.asm'
mov dx, 20h
mov ax, 4401h
int 21h
jc error3
xor ax, ax
error3:
mov xRC, ax
pop edx
pop ebx
}
#ifdef MILEC_DEBUG
eprintf1("xRC: %i\n", xRC);
#endif
copy3:
/* copy file to printer */
while ((count = fread(buffer, 1, PRINT_BUF_SIZE, f)) != 0) {
#ifdef MILEC_DEBUG
eprintf1("%i byte(s) read...\n", count);
#endif
WriteFile(PPrinter, buffer, count, &written, NULL);
if (written != count) {
#ifdef MILEC_DEBUG
eprintf("Erreur écriture sur 'LPT1' !\n");
#endif
free(buffer);
fclose(f);
CloseHandle(PPrinter);
return FALSE;
}
}
CloseHandle(PPrinter);
EDIT by rr: added {code} tag
Complete thread:
- GhostScript 8.57 for DOS (V0.00) available ! - Michel LECLERC, 20.07.2007, 15:21 (DOSX)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- GhostScript 8.57 for DOS (V0.00) available ! - rr, 20.07.2007, 16:11
- GhostScript 8.57 for DOS (V0.00) available ! - Rugxulo, 22.07.2007, 00:56
- GhostScript 8.57 for DOS (V0.00) available ! - rr, 22.07.2007, 21:17
- GhostScript 8.57 for DOS (V0.00) available ! - Rugxulo, 22.07.2007, 00:56
- GhostScript 8.57 for DOS (V0.00) available ! - Japheth, 20.07.2007, 19:29
- GhostScript 8.57 for DOS (V0.00) available ! - Michel LECLERC, 24.07.2007, 16:05
- GhostScript 8.57 for DOS (V0.00) available ! - Japheth, 24.07.2007, 17:46
- GhostScript 8.57 for DOS (V0.00) available ! - Michel LECLERC, 24.07.2007, 16:05
- GhostScript 8.57 for DOS (V0.00) available ! - flox, 21.07.2007, 16:34
- GhostScript 8.57 for DOS (V0.00) available - how to use it ? - DOS386, 23.07.2007, 02:29
- GhostScript 8.57 for DOS (V0.00) available - how to use it ? - Japheth, 24.07.2007, 11:35
- GhostScript 8.57 for DOS (V0.00) available - how to use it ? - Iw2evk, 24.07.2007, 13:29
- GhostScript 8.57 for DOS (V0.00) available - how to use it ? - Steve, 24.07.2007, 20:05
- GhostScript 8.57 for DOS (V0.00) available - how to use it ? - Japheth, 24.07.2007, 11:35
- GhostScript 8.57 for DOS (V0.01) available ! - Michel LECLERC, 24.07.2007, 16:51
- GhostScript 8.57 for DOS (V0.01) available ! - Laaca, 31.07.2007, 21:14
- GhostScript 8.57 for DOS (V0.00) available ! - rr, 20.07.2007, 16:11
Mix view