Delphi Newbie needs help (Madison R. Smith) wrote:

>I'd make it easy by putting the Dialogs unit in the uses clause of the
>unit where I wanted to open a file, defining a local variable of type
>TOpenDialog in the procedure where I open a file, then replacing the
>Application.ExecDialog statement from the Borland 7.0 code with the
>OpenDialog.Execute.  Unfortunately doing so gives me a GPF currently (it

If you want to do it that way, you'll need to Create the OpenDialog
component and may have a couple other hoops to jump through.  (They
may or may not apply to nonvisual components.)

The standard way to do it, though, is to drop a TOpenDialog on the
form associated with the unit (or any form in the project, if you're
willing to deal with scope specification) and let Delphi take care of
Creation and Destruction automagically.