S
Sarang
Hi,
I have this code that makes the form as an MDIChild:
chartWindowController.GetForm().MdiParent =
_expertTradeMainFrm;
chartWindowController.GetForm().WindowState
=FormWindowState.Normal;
chartWindowController.GetForm().Show();
The above code snippet throws exception when Show() is called:
Message "Object reference not set to an instance of an object."
System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.ToolTip.CreateHandle()
at System.Windows.Forms.ToolTip.get_Handle()
at System.Windows.Forms.ToolTip.WmWindowPosChanging(Message& m)
at System.Windows.Forms.ToolTip.WndProc(Message& msg)
at
System.Windows.Forms.ToolTip.ToolTipNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SetFocus(HandleRef
hWnd)
at
System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
at System.Windows.Forms.Form.set_Active(Boolean value)
at System.Windows.Forms.Form.ActivateMdiChildInternal(Form form)
at System.Windows.Forms.Form.WmMdiActivate(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
But when the same is not a MDIChild then it works fine i.e., if I
comment the line
chartWindowController.GetForm().MdiParent = _expertTradeMainFrm,
then
the application works fine.but ouptput is shown in independent window
I have Visual Team Edition 2005 for Developers + Windows XP Sp2.
Can anyone let me know what could be the reason or how to fix it.
Thanks in advance.
Regards
Sarang
I have this code that makes the form as an MDIChild:
chartWindowController.GetForm().MdiParent =
_expertTradeMainFrm;
chartWindowController.GetForm().WindowState
=FormWindowState.Normal;
chartWindowController.GetForm().Show();
The above code snippet throws exception when Show() is called:
Message "Object reference not set to an instance of an object."
System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.ToolTip.CreateHandle()
at System.Windows.Forms.ToolTip.get_Handle()
at System.Windows.Forms.ToolTip.WmWindowPosChanging(Message& m)
at System.Windows.Forms.ToolTip.WndProc(Message& msg)
at
System.Windows.Forms.ToolTip.ToolTipNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SetFocus(HandleRef
hWnd)
at
System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
at System.Windows.Forms.Form.set_Active(Boolean value)
at System.Windows.Forms.Form.ActivateMdiChildInternal(Form form)
at System.Windows.Forms.Form.WmMdiActivate(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
But when the same is not a MDIChild then it works fine i.e., if I
comment the line
chartWindowController.GetForm().MdiParent = _expertTradeMainFrm,
then
the application works fine.but ouptput is shown in independent window
I have Visual Team Edition 2005 for Developers + Windows XP Sp2.
Can anyone let me know what could be the reason or how to fix it.
Thanks in advance.
Regards
Sarang