Will adding some thread control fix this problem?

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 :eek:/

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
 
R

Rob Meade

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:

actually not entirely correct - it seems that this fails on the first
iteration also...

Wondering now actually if the fact that its a 'mailbox' directory is that
cause?

Again - any info appreciated,

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top