VON#
Confessions of a code junkie
RSS
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
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.
Home
Tags
Blend
Design
IADNUG
Projects
Stuff
Tips and Tricks
Wishlist
Archive
October, 2008 (1)
September, 2008 (1)
August, 2008 (1)
July, 2008 (2)
June, 2008 (2)
May, 2008 (2)
March, 2008 (2)
February, 2008 (8)
January, 2008 (4)
December, 2007 (6)
November, 2007 (2)
Blogroll
Eric Sink
Javier Lozano
Jeff Atwood
Joel Spolsky
Nick Parker
Paul Graham
Scott Hanselman
Tim Gifford