小编AU_*_*ost的帖子

对EIdConnClosedGracefully例外进行故障排除?

我们使用Delphi 7运行的软件通过电子邮件生成并向各利益相关方发送报告.在每天发送的大约30-40份报告中,每天有2-4份不同的报告因例外情况而失败:"EIdConnClosedGracefully"

我试图找出为什么会发生这种情况以及如何在代码中捕获它.这是我们到目前为止所拥有的:

try
   // Code that Populates "mess" (a tIdMessage variable)

   if (not nSMTP.Connected) then
   begin
     nSMTP.Connect;
   end;

   try
     nSMTP.Send(mess);      
   except on E : Exception do
     begin
       resend := E.Message;
       // AutoReports_ExceptionMessage is a string that holds the Exception message
       AutoReports_ExceptionMessage := 'Attempt #1: ' + resend; 
     end;
   end;

   if (resend <> '') then   // If there is an exception triggered, resend the email
   begin
     try
       nSMTP.Send(mess);
     except on E : Exception do
       begin
         resend := E.Message;
         AutoReports_ExceptionMessage := …
Run Code Online (Sandbox Code Playgroud)

delphi exception-handling delphi-7

4
推荐指数
1
解决办法
2445
查看次数

在Delphi中对TPageControl进行适当的验证

我正在使用Delphi 7代码,以确保在用户可以切换选项卡之前已在选项卡上输入注释.

选项卡位于a上TPageControl,此代码被触发OnExit

procedure TfCallerInfo.tsChaplainExit(Sender: TObject);
begin
  { Compare the saved DB value with the text in the comments field }
  if (dmMain.qChaplainCOMMENTS.AsString <> dbmChapComments.Text) then
    begin
      ShowMessage ('Please save the comments before proceeding.');
      pcDetail.ActivePage := tsChaplain;      // Remain on the Current Page
      tsChaplain.SetFocus;
    end;
end;
Run Code Online (Sandbox Code Playgroud)

tsInfoRequest例如,当用户单击另一个选项卡时,验证会触发,但活动页面将变为tsInfoRequest而不是保留tsChaplain.

知道我做错了什么吗?

delphi validation tabs delphi-7

1
推荐指数
1
解决办法
164
查看次数

将SQL查询的结果链接到Delphi 7中的kbmMemtable

我试图修复用Delphi 7编写的旧程序的一部分.

目前,我有正确的查询(和正确的结果),但我无法弄清楚如何在kbmMemtable中显示结果(这是应用程序的其余部分使用)

有关文件的任何想法/建议/链接?

delphi delphi-7

0
推荐指数
1
解决办法
2034
查看次数

解决地址访问冲突问题.读取地址00000000

在整个组织的计算机上部署了相同版本的Delphi 7 Code.

每次用户A访问计算机F1上的记录Z时,都会显示以下错误:

Access violation at address 00642E83 in module 'foo.exe'. Read of address 00000000
Run Code Online (Sandbox Code Playgroud)

我和我的用户在我自己的计算机上执行了相同的步骤,并且在另一台计算机上跟另一个人的用户执行了相同的步骤,并且无法复制它(因此无法调试...).

根据要求提供附加信息(不确定这将有多大帮助)

  • 记录Z是Interbase DB中的一行,其中包含已呼入的人员的联系人和呼叫历史记录.
  • 我们组织中的所有计算机都使用相同版本的Windows 7.

那么......

  • 用户B访问计算机F2上的记录Z没有错误.
  • 用户C访问计算机F3上的记录Z,没有错误.
  • 用户A访问计算机F4上的记录Z没有错误.
  • 用户A访问计算机F1上的记录Z(重启后),在提到的相同地址存在相同的错误.

计算机F1似乎是罪魁祸首.但是,此时,我不确定如何进一步排除故障.

有什么建议?

delphi delphi-7 access-violation

-2
推荐指数
1
解决办法
1万
查看次数