Iam working in c++ .i have an problem while run an application ,which have my dll within it ,My dll code is suitable to application (needed process).i wrote a log file (xml file) throughout application using fopen within all function(dll source) ,here i receive exception like “cannot access the file ,due to using by another process.” .please help me ,how can manage a file ,where can use only one process at a time…
Share
Unless you are using a different file for each process that uses your DLL then the problem is that you have the potential for multiple processes trying to access the same resource.
You should do one of the following:
separate file for each calling
process.
semaphores, mutexes or critcial
sections and wait states to control
access to the file.
as a process in its own right and
directly controls data passed to it
to place into the file.