且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Windows Mobile应用程序使用UnhandledException问题

更新时间:2022-06-25 03:39:51

我过这样的问题来了也。这是在.NET CF(V2.0)一个已知的问题,但我也有它同时采用V3.5(虽然其发生的情况是更具体的)。你可以找到的(旧的和仍然活跃)的Bug 这里。

I came across this problem as well. This is a known issue in .NET CF (v2.0), but I also had it while using v3.5 (although the situations in which it occurs are more specific). You can find the (old and still active) bug report here.

调用的MessageBox.show()会导致它立即关闭,但对我来说有两种解决方法: 1)调用的MessageBox.show()第二次。然后,它不会被阻塞,直到被用户关闭。您可以检查第一的MessageBox.show()收prematurely通过检查的DialogResult。我不记得这导致它返回什么时候失败了,我记得是给非默认的结果。

Calling MessageBox.Show() causes it to close immediately, but in my case there were two workarounds: 1) Call the MessageBox.Show() a second time. It then does block until closed by the user. You can check the first MessageBox.Show() closed prematurely by checking the DialogResult. I don't remember which result it returned exactly when it failed, I remember it giving a non-default result.

2)创建自定义表单并调用的ShowDialog()上。它为我工作,但另一些报道这是行不通的。你也可以调用Show(),并阻止它自己(不要忘记调用Application.DoEvents(),所以它使处理的事件)。

2) Create a custom Form and call ShowDialog() on that. It worked for me, but others have reported it doesn't work. You could also call Show() and make it blocking yourself (don't forget to call Application.DoEvents() so it keeps processing events).