[Lazarus] savedialog is not shown

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 6 13:45:33 CEST 2012


Andrea Mauri <andrea.mauri.75 at gmail.com> hat am 6. Juli 2012 um 13:09
geschrieben:

> Dear all,
> also removing the out of memory problem the savedialog is not shown.
> Someone can give me a feedback in order to understand the problem? What
> can I check in order to understand why the savedialog is not shown?


If there is an out of memory exception many things can go wrong.
Make sure the out of memory exception only occurs within your function and only
because you allocated a big chunk of memory.
There must always be enough memory for the error handling.

Then check with a debugger if any other exception is happening.


> It is a big issue for me since this affect one of our commercial product.


Can you show some more context code?

Mattias





> > Let me know,
> Andrea
>
> Il 03/07/2012 10:28, Andrea Mauri ha scritto:
> > Il 02/07/2012 15:56, Martin ha scritto:
> >>
> >> I don't know anything about the issue itself, but have you tried setting
> >> a watchpoint (context menu in watches list). (Scope = global / Acess
> >> write)
> >>
> >> Set the watchpoint after TCommonDialog.DoExecute has initialized the
> >> value. The watchpoint should stop execution if the value is modified
> >
> > I tried to evaluate when FUserChoice is assigned 2 (mrCancel).
> >
> > function TCommonDialog.DoExecute : boolean;
> > var
> >    CanClose: boolean;
> > begin
> >    FCanCloseCalled := False;
> >    if Assigned(FOnShow) then
> >      FOnShow(Self);
> >
> > --> before this is FUserChoice=0 (mrNone)
> >
> >    TWSCommonDialogClass(WidgetSetClass).ShowModal(Self);
> >
> > --> after this is  FUserChoice=2 (mrCancel)
> >
> > I look deeper and I found that in:
> >
> > class procedure TWin32WSOpenDialog.VistaDialogShowModal(ADialog:
> > IFileDialog; const AOpenDialog: TOpenDialog);
> > var
> >    FileDialogEvents: IFileDialogEvents;
> >    Cookie: DWord;
> >    CanClose: Boolean;
> > begin
> >    FileDialogEvents := TFileDialogEvents.Create(AOpenDialog);
> >    ADialog.Advise(FileDialogEvents, @Cookie);
> >    try
> >      AOpenDialog.DoShow;
> >      repeat
> >        ADialog.Show(GetParentWnd);
> >
> > --> I set a breakpoint on the line below, the dialog is not shown,
> > UserChoice in the following 'if' line is  mrNone, so different from mrOk
> > and then UserChoice is set to mrCancel
> >
> >        if (AOpenDialog.UserChoice <> mrOk) then
> >        begin
> >          CanClose := True;
> >          AOpenDialog.DoCanClose(CanClose);
> >          AOpenDialog.UserChoice := mrCancel;
> >        end
> >        else
> >          CanClose := True;
> >      until CanClose;
> >    finally
> >      ADialog.unadvise(Cookie);
> >      FileDialogEvents := nil;
> >    end;
> > end;
> >
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120706/7531635b/attachment-0003.html>


More information about the Lazarus mailing list