Share FileHandle

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Hi

I'd like to let my dll write into the clients logfile.
using this code:

'# client-side:

Private f%
Private mySrv As MyProj.MyCls

f = FreeFile(1)
Open "c:\data\test.log" For Append Access Write Shared As #f
Set mySrv = New MyProj.MyCls
mySrv.LogFileHandle = f

'# server-side, MyCls.cls

Private m_hndLogFile%

Public Property Let LogFileHandle(newHandle As Integer)
m_hndLogFile = newHandle
End Property

..
.

Print #m_hndLogFile, "some text"

Any Time i try to Print sth into the file, i get an error (5, invalid argument)
(or Err 52: invalid filename or number, if i use FreeFile(0))

I tried all different kinds of lock/share-modes also changed FreeFile(1) to
FreeFile(0) or a constant number, but with no luck.
it seems impossible to get write-access to the logfile from the dll-project.
The file itself has no attributes set. Any hints, work-arounds?


--
Gruesse, Christoph

Rio Riay Riayo - Gordon Sumner, 1979
.