1

MFC application with CLR support enabled (.net framework 4.7.2) that references a c# assembly that contains WinForms controls. These controls use Control.DeviceDpi but at runtime this api always returns 96.

Adding an MFCApplication.exe.config with EnableWindowsFormsHighDpiAutoResizing solves the issue. Control.DeviceDpi reports accurate dpi.

Is there a way to embed this .config in the MFCApplication.exe ? Or could this flag be set programmatically at startup? Are there some best practice in this regard ?

ekt
  • 129
  • 2
  • 11

0 Answers0