[Mono-bugs] [Bug 76901][Wis] New - FileDialog.FileOk causes InvalidCastException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Dec 3 06:03:07 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76901

--- shadow/76901	2005-12-03 06:03:07.000000000 -0500
+++ shadow/76901.tmp.27711	2005-12-03 06:03:07.000000000 -0500
@@ -0,0 +1,112 @@
+Bug#: 76901
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FileDialog.FileOk causes InvalidCastException
+
+FileDialog.OnFileOk() assumes that FileOk event is EventHandler, but it is
+CancelEventHandler. Thus if an event handler is set then it causes
+InvalidCastException.
+
+sample repro is being attached as a patch for swf/winforms/filedialog.
+Apply the patch, make, run, open the file dialog, and cancel (or select any
+files).
+
+Actual Results:
+
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type.
+in <0x00038> System.Windows.Forms.FileDialog:OnFileOk
+(System.ComponentModel.CancelEventArgs e)
+in (wrapper remoting-invoke-with-check)
+System.Windows.Forms.FileDialog:OnFileOk
+(System.ComponentModel.CancelEventArgs)
+in <0x009df>
+System.Windows.Forms.FileDialog+FileDialogPanel:OnClickOpenSaveButton
+(System.Object sender, System.EventArgs e)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+in <0x0001d> System.Windows.Forms.Control:OnClick (System.EventArgs e)
+in <0x000dd> System.Windows.Forms.Button:OnClick (System.EventArgs e)
+in <0x000f8> System.Windows.Forms.ButtonBase:OnMouseUp
+(System.Windows.Forms.MouseEventArgs mevent)
+in <0x0000d> System.Windows.Forms.Button:OnMouseUp
+(System.Windows.Forms.MouseEventArgs e)
+in <0x00611> System.Windows.Forms.Control:WndProc
+(System.Windows.Forms.Message m)
+in <0x00060> System.Windows.Forms.ButtonBase:WndProc
+(System.Windows.Forms.Message m)
+in <0x0000d> System.Windows.Forms.Button:WndProc
+(System.Windows.Forms.Message m)
+in <0x00014> System.Windows.Forms.Control+ControlNativeWindow:WndProc
+(System.Windows.Forms.Message m)
+in <0x0011e> System.Windows.Forms.NativeWindow:WndProc (IntPtr hWnd, Msg
+msg, IntPtr wParam, IntPtr lParam)
+in <0x00016> System.Windows.Forms.XplatUIX11:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x00015> System.Windows.Forms.XplatUI:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x00792> System.Windows.Forms.Application:ModalRun
+(System.Windows.Forms.Form form)
+in <0x000ee> System.Windows.Forms.CommonDialog:ShowDialog (IWin32Window
+ownerWin32)
+in <0x0000c> System.Windows.Forms.CommonDialog:ShowDialog ()
+in (wrapper remoting-invoke-with-check)
+System.Windows.Forms.CommonDialog:ShowDialog ()
+in <0x00097> testwin.MainForm:OnClick (System.Object sender,
+System.EventArgs e)in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+in <0x0001d> System.Windows.Forms.Control:OnClick (System.EventArgs e)
+in <0x000dd> System.Windows.Forms.Button:OnClick (System.EventArgs e)
+in <0x000f8> System.Windows.Forms.ButtonBase:OnMouseUp
+(System.Windows.Forms.MouseEventArgs mevent)
+in <0x0000d> System.Windows.Forms.Button:OnMouseUp
+(System.Windows.Forms.MouseEventArgs e)
+in <0x00611> System.Windows.Forms.Control:WndProc
+(System.Windows.Forms.Message m)
+in <0x00060> System.Windows.Forms.ButtonBase:WndProc
+(System.Windows.Forms.Message m)
+in <0x0000d> System.Windows.Forms.Button:WndProc
+(System.Windows.Forms.Message m)
+in <0x00014> System.Windows.Forms.Control+ControlNativeWindow:WndProc
+(System.Windows.Forms.Message m)
+in <0x0011e> System.Windows.Forms.NativeWindow:WndProc (IntPtr hWnd, Msg
+msg, IntPtr wParam, IntPtr lParam)
+in <0x00016> System.Windows.Forms.XplatUIX11:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x00015> System.Windows.Forms.XplatUI:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x00222> System.Windows.Forms.Application:Run ()
+in <0x000a4> System.Windows.Forms.Application:Run
+(System.Windows.Forms.ApplicationContext context)
+in <0x0002e> System.Windows.Forms.Application:Run
+(System.Windows.Forms.Form mainForm)
+in <0x0001f> testwin.MainForm:Main (System.String[] args)
+
+
+Expected Results:
+
+no exception.
+
+How often does this happen? 
+
+consistently.
+
+Additional Information:
+
+This is the first blocker I met to run SharpVectorGraphics
+https://sourceforge.net/projects/svgdomcsharp/
+
+A fix being attached.


More information about the mono-bugs mailing list