printing on shared receipt printer in Win 7 doesn't work

ruan007

New Member
Hello Guys,

I have encountered a problem with printing on windows 7 from 4gl code. we have two computers(till_01 and till_02) just upgraded to Win7, and a receipt printer is installed and shared in till_01, When we tried to print a cash receipt from till_02 using the following code, we received Error "**Unable to open file: \\till_01\receipt. Errno=2.(98)"

Code:
DEF VAR spoolFile AS CHAR NO-UNDO.
DEF VAR cprinter   AS CHAR         NO-UNDO.
DEF VAR memoryFile  AS MEMPTR       NO-UNDO.
 
assign
    spoolFile = "c:\temp\receipt.txt"
    cprinter  = "\\till_01\receipt".
 
FILE-INFO:FILE-NAME = spoolFile.
SET-SIZE(memoryFile) = FILE-INFO:FILE-SIZE.
INPUT FROM VALUE(spoolFile) BINARY NO-CONVERT.
IMPORT memoryFile.
INPUT CLOSE.
 
OUTPUT TO VALUE(cprinter) BINARY NO-CONVERT.
EXPORT memoryFile.
OUTPUT CLOSE.
SET-SIZE(memoryFile) = 0.

This problem only seem to happen in a win7 to win7 environment, the printing works when one of the till is not win7. such as winXP/win7, Win2000/Win7 or XP/XP. I am not sure if it is a security issue, Can anybody shed some lights please?

Thanks in advance.
 

viro

New Member
we have the same problem with win7 pc's, and don't have still the solution....

anyone with experience and some ideas?
@ruan007: did you find a solution?

thx
viro
 

ruan007

New Member
aha, yes, I did. Sorry, I should have updated this thread.

don't use the output statement, sending the file directly to the printer will work:

OS-COPY value(filename) VALUE(printername).

Cheers
 
Top