Wednesday, August 13, 2003

Fixed.  If we move all our initialization code to run after the controls have been fully created and added to their parent’s Controls collection then everything works just fine, and InvokeRequired returns what it should.  Again, the more I think about this problem the more it makes sense that it would work this way.  However, what I would expect is for the call to InvokeRequired to throw an exception if it can’t really determine the right answer (e.g. isn’t initialized properly?) rather than just returning false.  If it had thrown an exception we would have found the problem right away, rather than having to discover it the hard way.  And since calling InvokeRequired on a control without a parent is apparently an exceptional case, it would be the right thing to do. 

If anyone who reads this is or knows a PM on the WinForms team, you might mention this issue. J 

Wednesday, August 13, 2003 9:35:03 PM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Related posts:
A new role
Configuring AD-LDS
Continuous Integration at SAO
Continuous Integration at SPIN
Code Leader is shipping
Firebug

Comments are closed.