We have a COM server DLL written in Delphi 7 that is used from a VCL application written in XE2.
On a Microsoft Surface Book, with a resolution of 3000x2000, the XE2 application starts fine and is scaled normally, but when the user clicks the option that causes the COM DLL to be used, the main form suddenly shrinks to half its size, along with the text and controls.
We have a related Delphi 7 VCL application that had the same problem but we now include a custom manifest that specifically states that DPIAware is false. This works fine on the Surface Book. We tried the same technique on the COM DLL but it has no effect.
We can get the XE2 program to scale correctly with our Delphi 7 COM DLL if we have the registry value for preferring external manifests and include a manifest file with the XE2 application. However, it also executes another XE2 application from within using WinExec, and this second XE2 application then scales badly. Including a manifest for the second XE2 app has no effect unless run directly and not from within the first XE2 app.
Strangely, or not, if we build a COM server in XE2 it always scales properly in high DPI situations, even without a custom manifest, so we are currently trying to convert the Delphi 7 DLL to XE2 but it's a lot of work as there are a number of legacy component packages that are no longer available for XE2.
Please note that the XE2 application scales small as soon as the CoCreate is called for the COM server. It does not scale back to its original size when the COM server is freed.
Does anyone have any ideas on how to get the Delphi 7 DLL to report to Windows that it is not DPI aware so that other non-DPI aware applications using it don't suddenly scale incorrectly?