R
Rob Meade
Hi all,
For an indepth summary of whats going on please see my other topic entitled
"Curious Problem" dated 25/04/2004
Anyway, that aside...
I have some code was failing to do what I wanted...I've dropped this around
the sub that I was calling (which never seemed to get fired)..
Try
parseEmail(filePath)
Catch ex As Exception
evtLog.Source = "ScanFolder"
evtLog.Log = "ScanFolder"
evtLog.WriteEntry("ScanFolder", ex.Message,
EventLogEntryType.Information)
End Try
Ok - so first time after starting the service things are fine - second time
the parseEmail sub doesn't run and the exception is caught writing this to
my event log:
Event Type: Information
Event Source: ScanFolder
Event Category: None
Event ID: 0
Date: 27/04/2004
Time: 18:33:13
User: N/A
Computer: TITUS
Description:
The process cannot access the file
"C:\Inetpub\mailroot\mailbox\kingswoodwebservices.co.uk\P3_Support.mbx\p3_20
04042718331307670000001b.eml" because it is being used by another process.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Ok - so its being used by another process - I can only assume my on service
etc (that this code is from)...
Therefore, based on a suggestion in my other topic I have looked at the
thread code...saw this:
Dim Thread1 As New System.Threading.Thread(AddressOf sometask)
Thread1.Start()
Figured I also needed Thread1.Join() etc - but that aside I seem to be a bit
lost with the replacement of the 'sometask' bit - I assumed this would be my
sub - ie, parseEmail - tried that get the following error:
Method 'Private Sub parseEmail(path As String)' does not have the same
signature as delegate 'Delegate Sub ThreadStart()'.
Now that means nothing to me at all
/
I think I would probably want my entire code in a thread to be honest, so
would probably need to start the threading at the top of the code
entirely...
Any help / assistance with this would be gratefully received.
Best regards
Rob
For an indepth summary of whats going on please see my other topic entitled
"Curious Problem" dated 25/04/2004
Anyway, that aside...
I have some code was failing to do what I wanted...I've dropped this around
the sub that I was calling (which never seemed to get fired)..
Try
parseEmail(filePath)
Catch ex As Exception
evtLog.Source = "ScanFolder"
evtLog.Log = "ScanFolder"
evtLog.WriteEntry("ScanFolder", ex.Message,
EventLogEntryType.Information)
End Try
Ok - so first time after starting the service things are fine - second time
the parseEmail sub doesn't run and the exception is caught writing this to
my event log:
Event Type: Information
Event Source: ScanFolder
Event Category: None
Event ID: 0
Date: 27/04/2004
Time: 18:33:13
User: N/A
Computer: TITUS
Description:
The process cannot access the file
"C:\Inetpub\mailroot\mailbox\kingswoodwebservices.co.uk\P3_Support.mbx\p3_20
04042718331307670000001b.eml" because it is being used by another process.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Ok - so its being used by another process - I can only assume my on service
etc (that this code is from)...
Therefore, based on a suggestion in my other topic I have looked at the
thread code...saw this:
Dim Thread1 As New System.Threading.Thread(AddressOf sometask)
Thread1.Start()
Figured I also needed Thread1.Join() etc - but that aside I seem to be a bit
lost with the replacement of the 'sometask' bit - I assumed this would be my
sub - ie, parseEmail - tried that get the following error:
Method 'Private Sub parseEmail(path As String)' does not have the same
signature as delegate 'Delegate Sub ThreadStart()'.
Now that means nothing to me at all

I think I would probably want my entire code in a thread to be honest, so
would probably need to start the threading at the top of the code
entirely...
Any help / assistance with this would be gratefully received.
Best regards
Rob