DelphiFAQ Home Search:

Customized Standard Dialogs with VCL in run-time package

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

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.

Comments:

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: