DelphiFAQ Home Search:
General :: Programming :: Delphi :: VCL
About the Delphi VCL (Visual Component Library)

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

This is the FULL list of all articles in this category.

Featured Article

Customized Standard Dialogs with VCL in run-time package

Problem:

I have been using a custom open file dialog, specifying a resource template, much like TOpenPictureDialog does. Works fine. However, when I use the run-time package VCL50 for my application, the open dialog no longer works.
It probably has to do with the instance of the module where the template resides (not the package VCL50, but my EXE). As I see it, the problem sits in Dialogs.TOpenDialog.DoExecute(), where the source of the template is specified as SysInit.HInstance. Does anyone know how to work around this?


Solution:

Peter Below advises:
Override the TaskModalDialog method of your custom dialog class, there you can cast the Dialogdata parameter to TOpenfilename and change the hInstance field to FindClassHInstance(Classtype) to get the module handle of the module your dialog class is in.

Generated 16:02:24 on Feb 22, 2018