August 20, 2019, 02:22:29 pm

News:

SMF - Just Installed!


TnrLogFile bugs

Started by bflorac, March 28, 2015, 06:40:22 pm

Previous topic - Next topic

bflorac

There are a few bugs in TnrLogFile.
1) The log file nor edit should be written to during designing. This is somewhat related to the fact that other components that use it are active during designing.  Beside having "if csDesigning in ComponentState then exit" in its functions, it should also have an Enable property.

2) In the function TnrLogFile.Add() it attempts to add text to fEdit which is a component of the main form.
     fEdit.Text := fEdit.Text + ss;
This is NOT thread safe. I worked around this by having all the text that goes to fedit, go to a TStringList. And then send a message to the log file so it is managed under the main thread.
      fStringsToPost.Add(ss);
      PostMessage(fHWnd, TH_MESSAGE,0, 0);

I can provide my source if needed.