Einzelnen Beitrag anzeigen

Ruio

Registriert seit: 6. Nov 2008
89 Beiträge
 
Delphi 2005 Personal
 
#8

Re: Wert aus Klasse nicht verfügbar

  Alt 22. Dez 2009, 16:37
Die Log-Funktion geht sonst aber, die AV wird nämlich geloggt.
Delphi-Quellcode:
constructor Tt4rCore.Create(AppName : String);
begin
  inherited Create;
//...
  //Errorlog
  ForceDirectories(Ft4rAppDataPath+T4R_LOGFOLDER_NAME+'\');
  FErrorLogFile := Ft4rAppDataPath+T4R_LOGFOLDER_NAME+'\'+FAppName+'.txt';
  FErrorLogLevel := GetIniValue(T4R_INI_SECTION_MAIN, T4R_INI_SETTING_LOGLEVEL, T4R_INI_SETTING_LOGLEVEL_DEFAULT);
  FErrorLogActive := true;
  Application.OnException := AppException;
end;

procedure Tt4rCore.AppException(Sender: TObject; E: Exception);
begin
  try
    if FErrorLogActive then
      ErrorLogWrite(T4R_FLAG_ERROR, '('+E.ClassName+') '+E.Message + ' (Error caused by ' + Sender.ClassName + ')');
  finally
    Application.ShowException(E);
  end;
end;
  Mit Zitat antworten Zitat