Skip to main content

I have network printer HP LaserJet Pro M428f-M429f with static IP address 10.0.0.27. It was installed using TPC/IP option on Windows 10. Printing from Windows is OK but from Cobol program I got error:

error code: 114, pc=350F, call=1, seg=0

114 Attempt to access item beyond bounds of memory (Signal 11)

When I try to print with another printer ( locally connected with USB) everything is normal.

This is my code:

PERFORM PRNW-OPEN.

PRNW-OPEN.
     *-------- move 1 to Prn-Flags.
     *-----------definisi pre poziva Prn-Flags------------------------
     move 0 to Prn-WinHand.
     move "Greska kod OPEN Printera !!! " to Prn-Errtxt.

     *-----------Izracunavanje duzine naziva liste--------------------
     MOVE 128 TO Prnw-len.
     MOVE PrnDoc-naz TO Prnw-InCHR.
     PERFORM PRNW-Title-Len.
     IF PrnDoc-naz = Space THEN;
     MOVE 5 TO PrnDoc-Len
     MOVE "Lista" TO PrnDoc-Naz.

     IF Prn-IndOPEN equal zero THEN;
     CALL "PC_PRINTER_OPEN" using Prn-Handle, Prn-DOC,
     by value Prn-Flags
     by value Prn-WinHand
     returning Prn-RetCode.

     if Prn-RetCode not equal zero PERFORM PRNW-ERR.
     MOVE 1 TO Prn-IndOPEN.
     move zero to Num-Lin.

Does anybody know what is happening?

I have network printer HP LaserJet Pro M428f-M429f with static IP address 10.0.0.27. It was installed using TPC/IP option on Windows 10. Printing from Windows is OK but from Cobol program I got error:

error code: 114, pc=350F, call=1, seg=0

114 Attempt to access item beyond bounds of memory (Signal 11)

When I try to print with another printer ( locally connected with USB) everything is normal.

This is my code:

PERFORM PRNW-OPEN.

PRNW-OPEN.
     *-------- move 1 to Prn-Flags.
     *-----------definisi pre poziva Prn-Flags------------------------
     move 0 to Prn-WinHand.
     move "Greska kod OPEN Printera !!! " to Prn-Errtxt.

     *-----------Izracunavanje duzine naziva liste--------------------
     MOVE 128 TO Prnw-len.
     MOVE PrnDoc-naz TO Prnw-InCHR.
     PERFORM PRNW-Title-Len.
     IF PrnDoc-naz = Space THEN;
     MOVE 5 TO PrnDoc-Len
     MOVE "Lista" TO PrnDoc-Naz.

     IF Prn-IndOPEN equal zero THEN;
     CALL "PC_PRINTER_OPEN" using Prn-Handle, Prn-DOC,
     by value Prn-Flags
     by value Prn-WinHand
     returning Prn-RetCode.

     if Prn-RetCode not equal zero PERFORM PRNW-ERR.
     MOVE 1 TO Prn-IndOPEN.
     move zero to Num-Lin.

Does anybody know what is happening?

Hi,

Which product and version number/Patch Update are you using?

The 114 might mean that the parameters are not defined correctly.

Can you please show me the working-storage definition for the parameters being passed to the PC_PRINTER_OPEN routine?


Hi,

Which product and version number/Patch Update are you using?

The 114 might mean that the parameters are not defined correctly.

Can you please show me the working-storage definition for the parameters being passed to the PC_PRINTER_OPEN routine?

After reinstalling printer drivers and setting up new TCP/IP Network connection printing works fine. 

Here is the code you requested:
01 Sel-Printer.
02 Prn-Handle pic x(4) comp-5.
02 Prn-DOC.
05 PrnDOC-len pic x(2) comp-5 Value 0.
05 PrnDOC-naz pic x(128) Value "Lista".
02 Prn-Flags pic x(4) comp-5 Value 1.
02 Prn-WinHand pic x(4) comp-5 Value 0.
02 Prn-RetCode pic 9(4) comp-5.
02 Prn-Errtxt pic x(28).
02 Prn-Buffer pic x(260) Value Space.
02 Prn-LBuff pic x(4) comp-5 Value 255.
02 Prn-Font.
05 Font-len pic x(2) comp-5 Value 5.
05 Font-naz pic x(128) Value "Roman".
02 Font-size pic x(4) comp-5 Value 13.
02 Font-Style pic x(4) comp-5 Value 08.
02 Prn-control pic x(4) comp-5.