EnableVisualStyles再次触击...

My friend Jeff Berkowitz got nailed by the EnableVisualStyles bug in WinForms 1.1 that causes a weird SEHException when calling ShowDialog().  Jeff and his team really push WinForms to the limit and he finds some crazy stuff, including a scary Resource Naming problem in VS.NET 2003.

我的朋友Jeff Berkowitz被WinForms 1.1中的EnableVisualStyles错误所困扰,该错误在调用ShowDialog()时导致怪异的SEHException 。 Jeff和他的团队确实将WinForms推到了极限,他发现了一些疯狂的东西,包括VS.NET 2003中一个可怕的资源命名问题

CLRSpy, Jeff Key, and Adam Nathan to the rescue though.  Although Jeff had debugged the problem and figured it out himself, CLRSpy would see the as an error probe and break on it.

CLRSpyJeff KeyAdam Nathan进行了救援。 尽管Jeff已经调试了问题并自己解决了问题,但CLRSpy会将其视为错误探测器并对其进行了中断。

Adam suggests three possible workarounds:

亚当建议三种可能的解决方法:

  1. Disable the PInvoke Calling Convention Mismatch probe, or

    禁用“ PInvoke呼叫约定不匹配”探针,或
  2. Uncheck "Break on Error Messages" in CLR SPY so you can ignore this message and not provoke the crash, or

    取消选中CLR SPY中的“错误消息破坏”,以便您可以忽略此消息而不引发崩溃,或者
  3. Use an XML manifest to enable XP themes, rather than using the EnableVisualStyles API.

    使用XML清单来启用XP主题,而不要使用EnableVisualStyles API。

Of course, using the manifest is the preferred method methinks.

当然,使用清单是方法的首选方法。

翻译自: https://www.hanselman.com/blog/enablevisualstyles-strikes-again

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值