<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head><body>
<p style="margin: 0px;"><span><span></span></span></p>
<p style="margin: 0px; "></p>
<div style="margin: 5px 0px;">
<br/>Andrea Mauri <andrea.mauri.75@gmail.com> hat am 6. Juli 2012 um 13:09 geschrieben:
<br/>
<br/>> Dear all,
<br/>> also removing the out of memory problem the savedialog is not shown.
<br/>> Someone can give me a feedback in order to understand the problem? What
<br/>> can I check in order to understand why the savedialog is not shown?
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">If there is an out of memory exception many things can go wrong.</p>
<p style="margin: 0px;">Make sure the out of memory exception only occurs within your function and only because you allocated a big chunk of memory. </p>
<p style="margin: 0px;">There must always be enough memory for the error handling. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Then check with a debugger if any other exception is happening.</p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
> It is a big issue for me since this affect one of our commercial product.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Can you show some more context code?</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Mattias </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
</div>
<div style="margin: 5px 0px;">
> > Let me know,
<br/>> Andrea
<br/>>
<br/>> Il 03/07/2012 10:28, Andrea Mauri ha scritto:
<br/>> > Il 02/07/2012 15:56, Martin ha scritto:
<br/>> >>
<br/>> >> I don't know anything about the issue itself, but have you tried setting
<br/>> >> a watchpoint (context menu in watches list). (Scope = global / Acess
<br/>> >> write)
<br/>> >>
<br/>> >> Set the watchpoint after TCommonDialog.DoExecute has initialized the
<br/>> >> value. The watchpoint should stop execution if the value is modified
<br/>> >
<br/>> > I tried to evaluate when FUserChoice is assigned 2 (mrCancel).
<br/>> >
<br/>> > function TCommonDialog.DoExecute : boolean;
<br/>> > var
<br/>> > CanClose: boolean;
<br/>> > begin
<br/>> > FCanCloseCalled := False;
<br/>> > if Assigned(FOnShow) then
<br/>> > FOnShow(Self);
<br/>> >
<br/>> > --> before this is FUserChoice=0 (mrNone)
<br/>> >
<br/>> > TWSCommonDialogClass(WidgetSetClass).ShowModal(Self);
<br/>> >
<br/>> > --> after this is FUserChoice=2 (mrCancel)
<br/>> >
<br/>> > I look deeper and I found that in:
<br/>> >
<br/>> > class procedure TWin32WSOpenDialog.VistaDialogShowModal(ADialog:
<br/>> > IFileDialog; const AOpenDialog: TOpenDialog);
<br/>> > var
<br/>> > FileDialogEvents: IFileDialogEvents;
<br/>> > Cookie: DWord;
<br/>> > CanClose: Boolean;
<br/>> > begin
<br/>> > FileDialogEvents := TFileDialogEvents.Create(AOpenDialog);
<br/>> > ADialog.Advise(FileDialogEvents, @Cookie);
<br/>> > try
<br/>> > AOpenDialog.DoShow;
<br/>> > repeat
<br/>> > ADialog.Show(GetParentWnd);
<br/>> >
<br/>> > --> I set a breakpoint on the line below, the dialog is not shown,
<br/>> > UserChoice in the following 'if' line is mrNone, so different from mrOk
<br/>> > and then UserChoice is set to mrCancel
<br/>> >
<br/>> > if (AOpenDialog.UserChoice <> mrOk) then
<br/>> > begin
<br/>> > CanClose := True;
<br/>> > AOpenDialog.DoCanClose(CanClose);
<br/>> > AOpenDialog.UserChoice := mrCancel;
<br/>> > end
<br/>> > else
<br/>> > CanClose := True;
<br/>> > until CanClose;
<br/>> > finally
<br/>> > ADialog.unadvise(Cookie);
<br/>> > FileDialogEvents := nil;
<br/>> > end;
<br/>> > end;
<br/>> >
<br/>>
<br/>>
<br/>>
<br/>> --
<br/>> _______________________________________________
<br/>> Lazarus mailing list
<br/>> Lazarus@lists.lazarus.freepascal.org
<br/>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
</div>
</body></html>