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


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

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Customized Standard Dialogs with VCL in run-time package


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?


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 8:02:04 on Sep 22, 2019