hi,
i searched in the forum for this problem but came up empty handed, hoping one of you can help me out with something...
i have this nifty winforms app (C#) which contains a usercontrol. the usercontrol (call it AAA) is instantiated in the class directly. AAA's contstructor calls the InitializeComponent() method. after InitializeComponent() returns construction of the AAA class continues, some additional objects are instantiated here. inside of InitializeComponent() are some events that are hooked up. now for the interesting part...
on my machine (and many others) the order of operations is as follows:
the main Form begins construction
usercontrol AAA begins construction
usercontrol AAA's InitializeComponent() is called then returns
construction of usercontrol AAA continues instantiating other objects then is complete
construction of main Form is complete
some events are fired in AAA and in Form (OnSize, OnPaint, etc).
now, on one particular machine the order is a tad bit different:
the main Form begins construction
usercontrol AAA begins construction
usercontrol AAA's InitializeComponent() is called
the moment usercontrol AAA's ResumeLayout() is called inside AAA's InitializeComponent() call events are fired.
crash! becase AAA did not get a chance to complete construction.
now, i know the fix but i don't know the reason for the difference. does anyone know
thanks,
scott

Object Construction and the firing of Events...