1
votes

Version: Delphi Berlin 10.1

I am encountering problems, in what I consider to be a vcl theme bug, that when applying a vcl style theme to the application, messages using TApplication.MessageBox are limited to 256 characters.

TApplication.MessageBox with 298 characters of text WITHOUT the VCL theme applied. All text is displayed correctly. Link: without VCL Style Theme

TApplication.MessageBox with 298 characters text WITH the VCL theme applied. The text is limited to 256 characters and the rest is cut. Link: with any VCL Style Theme (Windows10 example)

I have already analyzed the TCustomStyle class of Vcl.Styles.pas but I have not found how to solve this unpleasant situation, so I would like your help.

EDIT:

Following the information that Andreas Rejbrand passed, it was possible to identify that it was a limitation in the buffer size of the GetText of TStyleHook that was limited to the array of [0..256] of char. With this information I created a detour for a new method where I increased the buffer size to array of [0..1023] of char which solved my problem.

Bug reported in QC Embarcadero:

https://quality.embarcadero.com/browse/RSP-14771

and

https://quality.embarcadero.com/browse/RSP-14772

Note: Unfortunately updating the IDE (which would solve the problem) to a newer version is not possible at this time.

1
Unable to reproduce in 10.3 and Windows 7. You should give a minimal complete example demonstrating the issue. But in any case, the best solution is to NOT use VCL styles. Then you get a completely bug-free GUI that behaves exactly as people expect, and, as a bonus, you get a visually much nicer GUI.Andreas Rejbrand
This is a known bug. See RSP-14772. It was fixed in Delphi 10.2.Andreas Rejbrand
@AndreasRejbrand: The comment with the bug report link and fix info should be posted as an answer instead.Ken White

1 Answers

2
votes

This is a known bug.

It was reported to Embarcadero in issue RSP-14772 and the bug was fixed in Delphi 10.2.

The best solution is to upgrade to the newest Delphi version, which also fixes a lot of other bugs.