EnableVisualStyles: Part of Evil Axis?
Jeff Key
Wednesday, July 16, 2003
Comments

[Note:  A nice guy emailed to thank me for the following, which I posted to my .NET list in May but forgot to put on the blog, so I'm posting it now; hopefully it will be useful to someone else.]

If you're using v1.1 of the Framework and encounter an SEHException and
have no idea what's causing it, check to see if you called
Application.EnableVisualStyles().  Apparently that is the source for a
number of problems that appear as SEHExceptions.

My problem in particular was happening when I tried to show a form with
ShowDialog().  If I used Show() instead, no problems.  All of my other
forms had no problems with ShowDialog, yet this one would crash the app.
After a bit of Googling, it appears that this error can come up almost
anywhere, so keep this in mind as it's almost always the solution.
Interestingly, using a manifest file to get the same results does NOT
cause the app to crash.  Go figure.


You might also be interested in my .NET development tools, samples, etc. (All free, of course!)