Same source, compiled by v880, owner draw menu is correct. But is not correct when compiled by v891.
Is it bug of v891 ? Pls see screenshot.png in attachment, Print menu has sub menu. I can exclude submenu arrow in v880, but i cann't in v891. You can try my demo with v880/v891 at vs 2019 community edition.
This is not a bug. It is a documented change to CDC. I refer you to the changes.txt file in the include folder. This file describes the changes made to the code for this version, including the changes to CDC.
To update your code for version 8.9.1 add pDC.Detach() to the end of the CMainFrame::DrawItem as shown below. Detach is required here because the DrawItem function makes changes to the device context that need to be kept after the function ends.
Same source, compiled by v880, owner draw menu is correct. But is not correct when compiled by v891.
Is it bug of v891 ? Pls see screenshot.png in attachment, Print menu has sub menu. I can exclude submenu arrow in v880, but i cann't in v891. You can try my demo with v880/v891 at vs 2019 community edition.
Tested with v8.9.0, it is ok. It seem v8.9.1 bug.
Tested with v8.9.0, it is ok. Maybe bug of v8.9.1.
If I replaced wxx_gdi.h file using v8.9.1 in v8.9, sub menu arrow will not exclude from dc.
It's ok when I switch back to v8.9.0.
Hi Kite,
Thanks for your question.
This is not a bug. It is a documented change to CDC. I refer you to the changes.txt file in the include folder. This file describes the changes made to the code for this version, including the changes to CDC.
To update your code for version 8.9.1 add pDC.Detach() to the end of the CMainFrame::DrawItem as shown below. Detach is required here because the DrawItem function makes changes to the device context that need to be kept after the function ends.
Best regards,
David
Last edit: David 2021-10-21
Hi, David
Thanks for your advise.