Hi,
I am working on a windows application whose primary task is to apply all the
properties of one control to another. Hence i am using the SetValue method of
the PropertyDescriptor. The application works fine but throws an exception
when the properties of combobox have to be set to the new control of the same
type.
The error stack is :
Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.OnVisibleChanged(Even tArgs e)
at System.Windows.Forms.Control.OnParentVisibleChange d(EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(Even tArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleCh anged(EventArgs e)
at System.Windows.Forms.Form.OnVisibleChanged(EventAr gs e)
at System.Windows.Forms.Control.OnParentVisibleChange d(EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(Even tArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleCh anged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at
System.Windows.Forms.Design.DesignerFrame.OverlayC ontrol.WndProc(Message&
m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr
wparam, IntPtr lparam)
at System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object
component,
Object value)
On debugging i found it breaks when the property 'Parent' is to be set.
There is no other place that it breaks. I am unable to get to the unmanaged
code that might be executing at this time.
Please help me how would i trace to the unmanaged code if that could a
possible problem in this situation.
Thanks
Serena