【发布时间】:2020-05-11 09:28:21
【问题描述】:
这是 Windows 10 中的错误还是只是卡住的键?
在我的 Delphi 2009 应用程序中,我通过一个放置在 while 循环内的简单输入框来询问用户的姓名,这样他们就不能将其留空。如果他们取消或单击“确定”而不输入名称,则会显示验证消息,然后循环循环并再次询问。
我的一个用户(使用 Windows 10,但我不知道是哪个版本)到了这一点,应用程序在这个循环中挂起。他们将屏幕描述为“闪烁”,屏幕截图显示了屏幕上的输入框和验证消息,但几乎是透明的,表明它们都显示得非常快。我的应用程序保留的日志也显示它到达了循环之前的点,但没有进一步。这个用户可以在不同的日子重现。
以防万一,我检查了这些 SO 帖子 here 和 here 但我的这段代码太简单了,我看不出会发生什么。
有问题的代码是
function TFrmProcessIPaddressRemoteAccess_JHM.CheckAndProcessUserIPaddress( TheIPaddress: string): boolean;
const
EMPTY_STRING = '';
var
comment : string;
begin
<stuff to do with checking if IP address is already on server>
comment := EMPTY_STRING;
while comment = EMPTY_STRING do
begin
comment := inputbox('Adding IP address',
'Your IP address is not in the list of those allowed access. ' + slinebreak
+'MAMbase is about to add it.' + slinebreak + slinebreak
+'Please enter your name so that the IP address can be identified', EMPTY_STRING);
if comment = EMPTY_STRING then
showmessage('Please enter your name');
end;
<stuff to do with adding the IP address and the comment to the server>
end;
【问题讨论】:
标签: delphi-2009 inputbox windows-10-desktop