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.
Before we take this further, it's odd that it suddenly started happening.
Did you recently apply some Windows updates? It appears a recent update broke printing, although the reports say it's resulting in a system crash. Microsoft has withdrawn those updates.
https://www.bleepingcomputer.com/news/microsoft/windows-10-crashes-when-printing-due-to-microsoft-march-updates/
UPDATE: Microsoft has released an "out-of-band" fix that should be offered as an "Optional Update". If the Windows Update client is not yet offering the fix, It can also be downloaded directly from here:
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.
March 9, 2021 - KB5000802 (OS builds 19041.867 and 19042.867) this is the last update that windows made on the pc.
March 9, 2021 - KB5000802 (OS builds 19041.867 and 19042.867) this is the last update that windows made on the pc.
Hi Wascar and Uwe,
I created a case yesterday (STOP RUN at line? in program P$DRAWBITMAP ()) as a customer reported P$Drawbitmap SelectObject failed on various customers but only in some PCs when printing a BMP file.
I just asked them to remove those Windows updates to check if that solves the problem.
Regards,
March 9, 2021 - KB5000802 (OS builds 19041.867 and 19042.867) this is the last update that windows made on the pc.
Well, that's certainly suspicious. You could try removing KB5000802 -- instructions are in the linked article. If you do, please reply and let us know if it helped. Based on Juan's report, this could be a widespread problem.
Hi Wascar and Uwe,
I created a case yesterday (STOP RUN at line? in program P$DRAWBITMAP ()) as a customer reported P$Drawbitmap SelectObject failed on various customers but only in some PCs when printing a BMP file.
I just asked them to remove those Windows updates to check if that solves the problem.
Regards,
Hi Juan: thanks! Please reply and let us know if this helped. I'll make sure support is aware of this thread.
Hi Juan: thanks! Please reply and let us know if this helped. I'll make sure support is aware of this thread.
Hello. Thank you very much Uwe, and Juan Manuel. I proceeded to uninstall the latest windows 10 update and the problem has been fixed.
Hi Wascar and Uwe,
I created a case yesterday (STOP RUN at line? in program P$DRAWBITMAP ()) as a customer reported P$Drawbitmap SelectObject failed on various customers but only in some PCs when printing a BMP file.
I just asked them to remove those Windows updates to check if that solves the problem.
Regards,
Hello. Thank you very much Uwe, and Juan Manuel. I proceeded to uninstall the latest windows 10 update and the problem has been fixed.
Hello. Thank you very much Uwe, and Juan Manuel. I proceeded to uninstall the latest windows 10 update and the problem has been fixed.
Confirmed! Removing the update solved the problem.
Hello. Thank you very much Uwe, and Juan Manuel. I proceeded to uninstall the latest windows 10 update and the problem has been fixed.
That's fantastic! Thanks for confirming.
Confirmed! Removing the update solved the problem.
That's fantastic! Thanks for confirming.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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?
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?
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.
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.
<<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.
<<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.
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.
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.
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
Hi everybody,
I would like to thank you for your assistance. Please keep us inform.
Hi everybody,
I would like to thank you for your assistance. Please keep us inform.
Hi everybody
Can anybody tell me what updates to remove from windows server 2012 R2 in order to avoid
the error message on P$DRAWBITMAP?
Thanking you in advance.
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.
Hello.
I have had problems to block windows update, I have deactivated all the possible options and every day windows re-install again. So far I have seen that this works for me.
Computer Management,
Services and Applications
services
windows update
right click
properties
startup type = disable
service status = stop, apply
Hi everybody
Can anybody tell me what updates to remove from windows server 2012 R2 in order to avoid
the error message on P$DRAWBITMAP?
Thanking you in advance.
Depending on which build of Windows 10 you have, it will be one or more of these patches:
wusa /uninstall /kb:5000802
wusa /uninstall /kb:5000808
wusa /uninstall /kb:5000822
wusa /uninstall /kb:5000809
You can also go to "View Update History" -> "Uninstall Updates" and find and remove the patches. But note that Wascar Guerrero1 reports that they get reinstalled unless you disable updates or set them to "notify-only" or "download only".
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.
Microsoft has now realized that there are more printing issues, and these appear to cover what we are seeing. Here's some info:
https://www.bleepingcomputer.com/news/microsoft/microsoft-warns-of-more-printing-issues-caused-by-march-updates/
Quoting from the article:
The printing issues highlighted by Microsoft include :
- Elements of the document might print as solid black/color boxes or might be missing, including barcodes, QR codes, and graphics elements, such as logos.
- Table lines might be missing. Other alignment or formatting issues might also be present.
- Printing from some apps or to some printers might result in a blank page or label.
Microsoft is working on a fix for these issues and will provide a solution during the coming days.