Hello,
I have a C# Windows Forms app that has many buttons on many tabbed pages, where each button corresponds to an adjacent text box. I type whatever I want into the text boxes and when I click a button it merely places the text in the corresponding text box onto the clipboard, and that's all the application does. I originally wrote it using VS2010 Pro on Win7-64bit Pro and it worked perfectly. However, I then downgraded to Win 8-64bit Pro and the same executable would no longer run properly in that when I clicked a button it no longer put the text on the clipboard. Along with Win 8 I also upgraded(?) to VS2012 Pro, so I merely recompiled the program in hopes that would fix the problem. However, when I tried to run it I got a runtime stack overflow in the automatically-generated "InitializeComponent" function, which never occurred before.
My application is big - there are over 66 thousand statements in the "InitializeComponent" function. Although I should not have to manually modify an automatically-generated file I went ahead and moved those 66K statements out of InitializeComponent, split them into ~10K groups, placed them into 6 separate functions. I then called those 6 functions from InitializeComponent, the stack overflow problem went away, and the application once again worked. Then I noticed another problem: In the Win7 version the application took about 10 seconds to startup but in the Win8 version it now takes over 1 minute. I'm using a 3.07GHz i7 CPU with 12GB RAM, a 256GB primary SDD with plenty of unused space on it, and a secondary HDD with plenty of unused space on it to.
So, I have these questions:
1. Why wouldn't the original Win7 .exe run properly on Win8?
2. After recompiling with VS2012 why did I start getting stack overflows in the InitializeComponent function?
3. Is there some way to increase the allowed stack space?
4. Why does the application now take such an unreasonable amount of time to start up?
Thanks,
Ray Mitchell