An application originally written in XE2 that uses styles within DLL's so that forms that popup from DLL's are the same style as the EXE, when updated to build in 10.2 Tokyo, now causes System Exceptions when opening certain forms from the EXE, or when closing certain forms in the EXE.
相关问题
- Delphi 10.2.2 IDE font size
- Delphi - Making asynchronous calls to WinRT API us
- CapsLock password message in TEdit visually fails
- Flat toolbar buttons with Delphi VCL Styles enable
- How do I get the version number of the current pro
相关文章
- Delphi Android app API level 26?
- Is VclStyle Bug ? TProgressBar.Style := pbstMarQue
- How to compare sets of enumerated types
- Why the exception is not caught by the try… except
- What has happened to ComboBox.Sorted := True; in D
- FireDAC mapping rules do not apply to parameters?
- How can we connect with a website? Getting SSL err
- How detect when a vcl style is changed?
I don't need to include the minimal reproducible example in this question, because I have an answer, that someone else may have been able to add to my original question had it not been closed so quickly, and then not re-opened even after making it on-topic.
Turns out it's a behavioural issue in VCL:
Exception if using comboboxes in a form that resides in a DLL and that uses VCLStyles.
Embarcadero won't fix it as it's not a "problem",
but there is a workaround which is to add the following line of code immediately before calling SetStyle or TrySetStyle in the DLL code:
Hopefully this will be of assistance to Delphi developers who run into this annoying problem after upgrading to the newer versions.
In my case, I add a conditional define to the project for the libraries, then add this code to the places where it setting styles, as the same unit is included in both EXE and DLL: