Delphi IDE (239)
Windows with Delphi (38)
About this site
Links to us
Customized Standard Dialogs with VCL in run-time package
This article has not been rated yet. After reading, feel free to leave comments and rate it.
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.