Re: Need design advice
"Ashutosh" wrote:
Since the DLL will be loaded into the address space of different
process, how do manage the file where its being written finally?
You need to decide where the log file will be stored and use this
path in every process. This path depends on the nature of your
processes. Do they all run under the same user credentials or not?
Do they belong to different applications? How different are their
security permissions? You should answer these questions before
doing any development.
Use `SHGetSpecialFolderPath' function to get a path where the log
file will be stored. Do not hardcode any paths and do not make any
asumptions about drive letters. Read more about different special
folders that exist in the system here:
"CSIDL"
http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx
How do I sync the data?
You will need to create systemwide (named) mutex and share it
between all instances of the logging DLL. So, only one instance at
a time will be able to write into log file. Read the documentation
in MSDN about `CreateMutex' function.
HTH
Alex