错误:“显示模态表单时无法显示非模态表单” [英] Error: "Can't show non-modal form when modal form is displayed"

查看:442
本文介绍了错误:“显示模态表单时无法显示非模态表单”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次运行我的应用时,有时(很少)在用户的计算机上出现该错误。我估计它会发生在所有案例中的1%或更少。

当没有显示应用程序的表单时,就会发生这种情况。 唯一的形式就是错误信息。

我无法在我的任何计算机上重新创建该错误。

我尝试通过给出错误来调试该问题用户将具有msgbox的特定准备的可执行文件放在Form_Load例程和子例程中的策略位置。

运行该可执行文件时没有问题。



此外,该应用程序采用Excel自动化。在启动时,它会检查是否存在Excel程序并连接到它。

正常情况下会发生以下序列:

Sub Main

Form_Load :

1.检查是否存在Excel程序并连接到它。

2. Me.Show>出现在Form_Load的开头(上面的(1)之后) )

3.启动画面(出现在Form_Load的末尾),它是带有倒数计时器的模态表格。

应用程序中没有更多的模态表格。

请注意,错误发生在 之前 Me.Show声明>用户报告没有看到GUI。



对这个问题的任何想法都非常赞赏,

/ jas

解决方案

首先删除它们不是一个好的调试方法的消息框。将它们替换为保存到日志文件的文本消息。


然后当实例(错误)发生时读取日志文件。


它也可能因为另一个应用程序或者用户正在使用excel等而发生。


否则无法调试具有间歇性问题的应用程序,而该问题尚未被发现。


That error appears sometimes (very seldom) on user's computer when running my app for the first time. I estimate it happens 1% of all cases or less.
It happens when none of the app's forms are displayed yet.The only form is just that error message.
I cannot recreate that error on any of my computers.
I tried to debug that problem by giving the user the specialy prepared executable with msgboxes placed in strategic locations in Form_Load routine and subroutines.
There was not problem when running that executable.

Also, that app employs Excel automation. On startup it checks for the existence of Excel program and connects to it.
In normal case the following sequence occurs:
Sub Main
Form_Load:
1. Checks for the existence of Excel program and connects to it.
2. Me.Show >appears at the beginning of Form_Load (after (1) above)
3. Splash screen (appears at the end of Form_Load) and it is a Modal form with the countdown timer.
There are no more Modal forms in the app.
Please note, that the error occurs before Me.Show statement > user reports not seeing GUI.

Any thoughts on that problem very appreciated,
/jas

解决方案

First remove the messageboxes they are not a good method of debugging. Replace them with text messages that are being saved to a log file.

Then when the instance (bug) happens read the log file.

It may also be happening because of another application or excel is being used by the user etc.

Otherwise it is impossible to debug an application with an intermittent problem which has not been even discovered yet.


这篇关于错误:“显示模态表单时无法显示非模态表单”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆