This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STOP RUN at line? in program P $ DRAWBITMAP ()

Hello. In my point of sales software, the invoice header is a .bmp which I print with the instruction. Only today on a pc my program does STOP RUN at line? in program P $ DRAWBITMAP (). I have tested the program on all PCs and only on that one does the error occur. I have verified that the .bmp file exists and replaced it with a fresh file. The problem has continued. I have uninstalled and installed rmcobol cobol version 12.17 and the problem continues. All this leads me to think that there is a problem with Windows 10 and rmcobol, can someone help me to know what is happening?

27321 CALL "P$DrawBitmap" USING "milogo.bmp",
27322 IZQUIERDO, TOPE, "Absolute", "Inches",
27323 ANCHO, ALTO, "Inches"
27324 WRITE REG-SAL FROM SPACES AFTER
27325 ADVANCING 1 LINES.

  • 0

    Hello. The solution of uninstalling the latest windows update works until the pc is turned off and on again. The problem persists even with the update uninstalled. Now there is nothing to uninstall.

  • 0 in reply to 

    Did you uninstall both updates?  This is the Windows 10 KB5000802 cumulative update by closing applications and opening a command prompt

    wusa /uninstall /kb:5000802

    To uninstall the Windows 10 KB5000808 cumulative update, use this command instead:

    wusa /uninstall /kb:5000808

    Also, the bleepingcomputer article now says that both updates are back and Microsoft says that nothing has changed. 

    I was able to reproduce this problem on a machine that has 5000808 installed (not 5000802) and determined that a fundamental Windows API call that "selects" the bitmap image into the printer's device context is returning failure with no additional information. The test program works perfectly on Windows 10 machines that were not updated.

    Also, setting Win7 or Win8 compatibility mode doesn't help.  And the problem occurs both in x86 and x64 programs.

    There is no way that we can work around this problem on our end as it's all correct and unchanged, so unless Microsoft release some kind of service bulletin with a work-around, it's going to have to be something Microsoft fixes.

  • 0 in reply to 

    After seeing Uwe's post, I tried pdraw sample program on my alternate Windows 10 machine.  (I just used this program to test for another thread about creating PDF, and it worked.)

    On the Win10 machine I used this morning, PDRAW worked fine.  That machine is normally turned off.  It does not have the update.

    On my 'active' Win10 machine, which has the update, the program stops at P$DrawBitmap.

     

  • 0 in reply to 

    Thanks, Tom.  I used the powershell get-hotfix command on the computer that fails the last few lines are:

    Security Update KB4580325 NT AUTHORITY\SYSTEM 10/16/2020 12:00:00 AM
    Security Update KB4586863 NT AUTHORITY\SYSTEM 11/11/2020 12:00:00 AM
    Update          KB4589211 NT AUTHORITY\SYSTEM  3/14/2021 12:00:00 AM
    Security Update KB4598479 NT AUTHORITY\SYSTEM  1/13/2021 12:00:00 AM
    Security Update KB4601395 NT AUTHORITY\SYSTEM  2/10/2021 12:00:00 AM
    Security Update KB5000908 NT AUTHORITY\SYSTEM  3/11/2021 12:00:00 AM
    Security Update KB5000808 NT AUTHORITY\SYSTEM  3/14/2021 12:00:00 AM

    It's KB5000808 that seems to have introduced the SelectObject() problem with selecting bitmaps into a printer-compatible memory device context. It's interesting that it was installed after the update was supposedly pulled and restored, but Windows was nagging for a reboot to install updates for a few days that I ignored.  It could have been downloaded earlier and left pending.

  • 0

    Hello everyone. The solution that Tom and Uwe have presented is correct. I had not been able to answer until now due to all the work that has caused me to uninstall the windows updates. I have created a .bat file with the instructions wusa / uninstall / kb: 5000802 wusa / uninstall / kb: 5000808 then I proceeded to shut down the PC and then turn it on and everything is fine again. Thanks.

  • 0 in reply to 

    Hi ,

    I have the same problem using the P$DRAWBITMAP , 

    Is the uninstall of kb:5000802 and KB5000808  the only solution until Microsoft 

    will be issue a new update which may be solve this problem?

    Are  there any other solution any other Microfocus  product which can be link with the RMCOBOL

    in order to replace the P$DRAWBITMAP?

     

     

     

  • 0 in reply to 

    Hello, I am not the best person to answer your questions, but I have the same concerns as you. I wrote to the Microfocus technical support department and I hope that they report the problem to Microsoft in the most professional way possible, so that it is taking into account or they will have to review the Cobol runtime to find alternatives to the problem. At the moment you have to uninstall the windows updates as described in previous comments: In windows, the option "settings", view update history, uninstall updates, Microsoft windows, proceed to uninstall the latest upgrades until the problem stops. Since new versions of Rmcobol usually require windows to be updated, so Microfocus, in case Microsoft doesn't solve it, they have to do something about it.

  • 0   in reply to 

    <<Since new versions of Rmcobol usually require windows to be updated>>

    Hmmm. I don't think that the installation script cares about this. It's just usually a good idea.

    <<so Microfocus, in case Microsoft doesn't solve it, they have to do something about it>>

    We are indeed looking at this problem and searching for workarounds but options are limited. We make the call to SelectObject to return the handle to the previously selected bitmap, and it returns NULL to indicate an error. But, we have no indication what the error actually is, let alone how to recover from the error.  But, rest assured, we're looking for one. The best one may be to cause the P$DRAWBITMAP to ignore the error and pretend the DRAWBITMAP succeeded. However, this will cause the page to print without the bitmap. This is, of course, something that can be done in the COBOL program temporarily right away. If you have access to the source, you can comment out the call to P$DRAWBITMAP and print without the bitmap until Microsoft corrects this problem, or we discover a workaround.

  • 0 in reply to   

    Mike,

    One possible work-around would be to use the ON EXCEPTION capability of the CALL, rather than the rather hostile STOP RUN.  This allows the developer to accommodate the issue (perhaps substitute a block of text for the logo/bit map), and await happier days from Microsoft.

  • 0

    It appears others are discovering the problem, and Microsoft is now aware (see the comments).

    https://stackoverflow.com/questions/66607946/calling-windows-selectobject-in-a-printer-compatible-device-context-returns-null