digitalmars.D.dwt - ProgressMonitorDialog : Access Violation
- yidabu (62/62) Jun 20 2008 jface ProgressMonitorDialog cause runtime Access Violation,
- Frank Benoit (5/76) Jun 20 2008 Thanks for the report yidabu.
- yidabu (41/56) Jun 20 2008 update to svn, still not work:
- Frank Benoit (6/27) Jun 20 2008 strange.
- yidabu (12/40) Jun 20 2008 perhaps the issue is I have not add -full to dsss buildflags to build a ...
- yidabu (10/28) Jun 20 2008 added -full dsss buildflag and got a new dwtx.lib, but get same object.E...
- yidabu (12/36) Jun 20 2008 dsss_objs and dsss_imports removed, but still not work
- yidabu (18/33) Jun 20 2008 change :
- Frank Benoit (5/34) Jun 21 2008 i had tested it with dmd 1.031 ... and indeed with dmd 1.028 it crashes.
- Frank Benoit (59/64) Jun 21 2008 Now it works with fork=false, but another anon class workaround was
- yidabu (11/88) Jun 21 2008 thanks a lot!
jface ProgressMonitorDialog cause runtime Access Violation, ddbg captured: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass95.handleEvent.dwt.widgets.Event.Event.__anonclass96.run (0x0040 d890) thread(3412) tested with dwt-win svn, dwtx svn, dmd 1.028 Example code: import dwt.DWT; import dwt.layout.FillLayout; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Listener; import dwt.widgets.Event; import dwt.widgets.Button; import dwtx.jface.dialogs.PopupDialog; import dwt.dwthelper.utils; import dwtx.jface.dialogs.ProgressMonitorDialog; import dwtx.core.runtime.IProgressMonitor; import dwtx.jface.operation.IRunnableWithProgress; import tango.core.Thread; void handleSelection(Event e, Shell shell) { void run(IProgressMonitor monitor) { monitor.beginTask("generate", 30); for(int i=0; i<100; i++) { if(monitor.isCanceled()) { return; } monitor.worked(1); Thread.sleep(50); } monitor.done(); } auto dialog = new ProgressMonitorDialog(shell); dialog.run(true, true, dgIRunnableWithProgress(&run)); } void main() { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button button = new Button(shell, DWT.PUSH); button.setText("&OK"); button.addListener(DWT.Selection, dgListener(&handleSelection, shell)); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Jun 20 2008
yidabu schrieb:jface ProgressMonitorDialog cause runtime Access Violation, ddbg captured: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass95.handleEvent.dwt.widgets.Event.Event.__anonclass96.run (0x0040 d890) thread(3412) tested with dwt-win svn, dwtx svn, dmd 1.028 Example code: import dwt.DWT; import dwt.layout.FillLayout; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Listener; import dwt.widgets.Event; import dwt.widgets.Button; import dwtx.jface.dialogs.PopupDialog; import dwt.dwthelper.utils; import dwtx.jface.dialogs.ProgressMonitorDialog; import dwtx.core.runtime.IProgressMonitor; import dwtx.jface.operation.IRunnableWithProgress; import tango.core.Thread; void handleSelection(Event e, Shell shell) { void run(IProgressMonitor monitor) { monitor.beginTask("generate", 30); for(int i=0; i<100; i++) { if(monitor.isCanceled()) { return; } monitor.worked(1); Thread.sleep(50); } monitor.done(); } auto dialog = new ProgressMonitorDialog(shell); dialog.run(true, true, dgIRunnableWithProgress(&run)); } void main() { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button button = new Button(shell, DWT.PUSH); button.setText("&OK"); button.addListener(DWT.Selection, dgListener(&handleSelection, shell)); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050
Jun 20 2008
On Fri, 20 Jun 2008 13:02:06 +0200 Frank Benoit <keinfarbton googlemail.com> wrote:yidabu schrieb:jface ProgressMonitorDialog cause runtime Access Violation, ddbg captured: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass95.handleEvent.dwt.widgets.Event.Event.__anonclass96.run (0x0040 d890) thread(3412) tested with dwt-win svn, dwtx svn, dmd 1.028Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: runtime exception: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.setMessage (0x0040dc1a) thread(266 8) ->us e(char[], bool, void*) () at DwtTest.d:42 from ProgressMonitorDialog alog.configureShell(class dwt.widgets.Shell.Shell, void*) . void __anonclass94.h andleEvent(class dwt.widgets.Event.Event, void*) . void __anonclass95.run(void*) () at DwtTest.d:42 from ProgressMonitorDialog l, void*) () at DwtTest.d:42 from Synchronizer () at DwtTest.d:42 from Display tThread.block(void*) () at DwtTest.d:42 from ModalContext wtx.jface.operation.IRunnableWithProgress.IRunnableWithProgress, bool, class dwt x.core.runtime.IProgressMonitor.IProgressMonitor, class dwt.widgets.Display.Disp lay) () at DwtTest.d:42 from ModalContext alog.run(bool, bool, class dwtx.jface.operation.IRunnableWithProgress.IRunnableW ithProgress, void*) () at DwtTest.d:42 from ProgressMonitorDialog Test.obj ets.Event.Event, void*) () at DwtTest.d:60 from EventTable -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Jun 20 2008
yidabu schrieb:On Fri, 20 Jun 2008 13:02:06 +0200 Frank Benoit <keinfarbton googlemail.com> wrote:strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adyidabu schrieb:jface ProgressMonitorDialog cause runtime Access Violation, ddbg captured: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass95.handleEvent.dwt.widgets.Event.Event.__anonclass96.run (0x0040 d890) thread(3412) tested with dwt-win svn, dwtx svn, dmd 1.028Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: ...
Jun 20 2008
On Sat, 21 Jun 2008 01:49:56 +0200 Frank Benoit <keinfarbton googlemail.com> wrote:yidabu schrieb:perhaps the issue is I have not add -full to dsss buildflags to build a static dwtx.lib. now I rebuild dwtx.lib, it may take two hours. -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/On Fri, 20 Jun 2008 13:02:06 +0200 Frank Benoit <keinfarbton googlemail.com> wrote:strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adyidabu schrieb:jface ProgressMonitorDialog cause runtime Access Violation, ddbg captured: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass95.handleEvent.dwt.widgets.Event.Event.__anonclass96.run (0x0040 d890) thread(3412) tested with dwt-win svn, dwtx svn, dmd 1.028Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: ...
Jun 20 2008
added -full dsss buildflag and got a new dwtx.lib, but get same object.Exception: Access Violation should remove dsss_objs and dsss_imports directory first to build dwtx.lib ? -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/perhaps the issue is I have not add -full to dsss buildflags to build a static dwtx.lib. now I rebuild dwtx.lib, it may take two hours.strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adThanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: ...
Jun 20 2008
On Sat, 21 Jun 2008 08:52:30 +0800 yidabu <yidabu.spam gmail.com> wrote:dsss_objs and dsss_imports removed, but still not work I'm no idea that why PopupDialog works but rogressMonitorDialog failed after update to svn. -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/added -full dsss buildflag and got a new dwtx.lib, but get same object.Exception: Access Violation should remove dsss_objs and dsss_imports directory first to build dwtx.lib ?perhaps the issue is I have not add -full to dsss buildflags to build a static dwtx.lib. now I rebuild dwtx.lib, it may take two hours.strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adThanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: ...
Jun 20 2008
change : dialog.run(true, true, dgIRunnableWithProgress(&run)); to: dialog.run(false, true, dgIRunnableWithProgress(&run)); Progress bar worked, and after monitor.done(), cause Exception: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass94.handleEvent.dwt.widgets.Event.Event.__anonclass95.run (0x0040 d891) thread(2004) seems it's another anonclass problem. -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adtested with dwt-win svn, dwtx svn, dmd 1.028Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050update to svn, still not work: ...
Jun 20 2008
yidabu schrieb:i had tested it with dmd 1.031 ... and indeed with dmd 1.028 it crashes. Your first example code should work now. With thechange : dialog.run(true, true, dgIRunnableWithProgress(&run)); to: dialog.run(false, true, dgIRunnableWithProgress(&run)); Progress bar worked, and after monitor.done(), cause Exception: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at dwtx.jface.dialog s.ProgressMonitorDialog.ProgressMonitorDialog.configureShell.dwt.widgets.Shell.S hell.__anonclass94.handleEvent.dwt.widgets.Event.Event.__anonclass95.run (0x0040 d891) thread(2004) seems it's another anonclass problem.strange. I tested it on linux and windows. are you sure you updated dwt-addons? this was the fix: http://www.dsource.org/projects/dwt-addons/changeset/83%3A028aedd523adupdate to svn, still not work: ...tested with dwt-win svn, dwtx svn, dmd 1.028Thanks for the report yidabu. It is fixed now. In your example code, i noticed this: Thread.sleep(50); // should be 0.050dialog.run(false, true, dgIRunnableWithProgress(&run));there is still a problem :/
Jun 21 2008
Frank Benoit schrieb:i had tested it with dmd 1.031 ... and indeed with dmd 1.028 it crashes. Your first example code should work now. With the > dialog.run(false, true, dgIRunnableWithProgress(&run)); there is still a problem :/Now it works with fork=false, but another anon class workaround was necessary. Also a fix in the example code is needed to make fork=false work. From the ProgressMonitorDialog doc: If fork is set to false, the runnable will run in the UI thread and it is the runnable's responsibility to call Display.readAndDispatch() to ensure UI responsiveness. The example code looks now like this: import dwt.DWT; import dwt.layout.FillLayout; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Listener; import dwt.widgets.Event; import dwt.widgets.Button; import dwtx.jface.dialogs.PopupDialog; import dwt.dwthelper.utils; import dwtx.jface.dialogs.ProgressMonitorDialog; import dwtx.core.runtime.IProgressMonitor; import dwtx.jface.operation.IRunnableWithProgress; import tango.core.Thread; version=NOFORK; void handleSelection(Event e, Shell shell) { void run(IProgressMonitor monitor) { monitor.beginTask("generate", 30); for(int i=0; i<100; i++) { if(monitor.isCanceled()) { return; } monitor.worked(1); Thread.sleep(0.050); version(NOFORK) Display.getCurrent().readAndDispatch(); } monitor.done(); version(NOFORK) Display.getCurrent().readAndDispatch(); } auto dialog = new ProgressMonitorDialog(shell); version(NOFORK) { dialog.run(false, true, dgIRunnableWithProgress(&run)); } else { dialog.run(true, true, dgIRunnableWithProgress(&run)); } } void main() { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button button = new Button(shell, DWT.PUSH); button.setText("&OK"); button.addListener(DWT.Selection, dgListener(&handleSelection, shell)); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
Jun 21 2008
On Sat, 21 Jun 2008 15:35:33 +0200 Frank Benoit <keinfarbton googlemail.com> wrote:Frank Benoit schrieb:thanks a lot! -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/i had tested it with dmd 1.031 ... and indeed with dmd 1.028 it crashes. Your first example code should work now. With the > dialog.run(false, true, dgIRunnableWithProgress(&run)); there is still a problem :/Now it works with fork=false, but another anon class workaround was necessary. Also a fix in the example code is needed to make fork=false work. From the ProgressMonitorDialog doc: If fork is set to false, the runnable will run in the UI thread and it is the runnable's responsibility to call Display.readAndDispatch() to ensure UI responsiveness. The example code looks now like this: import dwt.DWT; import dwt.layout.FillLayout; import dwt.widgets.Display; import dwt.widgets.Shell; import dwt.widgets.Listener; import dwt.widgets.Event; import dwt.widgets.Button; import dwtx.jface.dialogs.PopupDialog; import dwt.dwthelper.utils; import dwtx.jface.dialogs.ProgressMonitorDialog; import dwtx.core.runtime.IProgressMonitor; import dwtx.jface.operation.IRunnableWithProgress; import tango.core.Thread; version=NOFORK; void handleSelection(Event e, Shell shell) { void run(IProgressMonitor monitor) { monitor.beginTask("generate", 30); for(int i=0; i<100; i++) { if(monitor.isCanceled()) { return; } monitor.worked(1); Thread.sleep(0.050); version(NOFORK) Display.getCurrent().readAndDispatch(); } monitor.done(); version(NOFORK) Display.getCurrent().readAndDispatch(); } auto dialog = new ProgressMonitorDialog(shell); version(NOFORK) { dialog.run(false, true, dgIRunnableWithProgress(&run)); } else { dialog.run(true, true, dgIRunnableWithProgress(&run)); } } void main() { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Button button = new Button(shell, DWT.PUSH); button.setText("&OK"); button.addListener(DWT.Selection, dgListener(&handleSelection, shell)); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
Jun 21 2008