Confessions of a code junkie
 
Wednesday, January 09, 2008

Error Creating Window Handle
 
So I was getting this real sweet "Error Creating Window Handle" exception in one of my apps when I went to ".Show()" a window in the app (not during the form's construction". I found that if I commented out attaching a DataSource to the a combobox, showing the form worked fine. After reading a lot about window handles and GDI objects and getting no where, lots of trial and error commenced. Apparently Combobox does not like having the "DisplayMember" property set after the datasource is set, but only if one of the objects in the datasource has null for its DisplayMember property. (The DisplayMember was a property called "Name", if one of the objects had null for its "Name" property, it blows up). But apparently if you set the DisplayMember BEFORE you set your datasource, it is ok to have a displaymember prop be null. Oy veh.


Wednesday, January 9, 2008 - 9:48 AM CST - Permalink kick it on DotNetKicks.com   Comments [0] -
Tags:


Comments are closed.
 


All Content © 2009, Jon von Gillern
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.


 


Tags

Archive

Blogroll