Author Topic: TnrLogFile bugs  (Read 453 times)

bflorac

  • Newbie
  • *
  • Posts: 6
    • View Profile
TnrLogFile bugs
« on: March 28, 2015, 07:40:22 pm »
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.