Re: Sharing Data in DLLs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

You should have the file open the less possible time, so you should
open/close it in each call.
Even more, it's possible that more than one process will try to write to it
at the same time. so you will still have a problem.

Possible solutions:
1- Use event log instead of a file.
2- Use a dedicated thread to write down the events, this thread will use a
sync queue to store the log entries that need to be written. it will fire
from time to time and try to write the entries to the file. The entries will
be generated by the UI thread (or any other worker thread)

Hope this help,

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Rajesh" <Rajesh@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3A3AE75E-1131-4D63-A2BB-553334D9CFB5@xxxxxxxxxxxxxxxx
Hi,

We are tyring to build a DLL which will write the log data to a text file.

Multiple executables should use this dll to write data to same text file.
We
are using a synchronized method (using TextWriter.Synchronized) for
writing
data to the text file. The class in the DLL (LogManagement) is implemented
using the Singleton pattern.

My problem is that when I try to write data from more that one executables
(and services) it gives me error and does not allow write to the file.

Any help is appreciated.

Thanks

Rajesh
http://www.slcltd.com


.



Relevant Pages

  • Re: backdoor.afcore.bb HELL
    ... free Firewall.With secure dll authentication enabled,by ... >the classic malware, the other is a monitoring service ... using registry entries and MSCONFIG itself ...
    (microsoft.public.security)
  • RE: Event Log entries?
    ... The server is a W2K web server with OWA 5.5. ... The workstation that was identified in the event log ... >| Subject: Event Log entries? ... >| Username: domain\computername$ ...
    (microsoft.public.win2000.security)
  • Re: Max number of items in a listbox?
    ... >> ListBox as sort of an event log. ... >> limiting the number of entries that can accumulate in this listbox ... >Sub AddLogEntry ...
    (microsoft.public.vb.general.discussion)
  • Re: Why does Application_Start fire twice?
    ... tell you which routine called/caused the restart and then you can work from ... > but nothing is written to the event log about a problem. ... > dll', No symbols loaded. ... >>>I need to know why the Application_Start function fires twice when it ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: backdoor.afcore.bb HELL
    ... malware as soon as it detects the other is deleted, ... using registry entries and MSCONFIG itself to track down as ... Tried uninstalling the dll, ftdpwmk.dll, but I get access denied. ... > I've tried searching google but didn't find anything. ...
    (microsoft.public.security)