473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Will adding some thread control fix this problem?

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

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
Nov 18 '05 #1
1 806
> 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
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: serge calderara | last post by:
Dear all, I have an application which timely create log file in XML format I ma using the SystemFileWatcher object to monitor creation of new file in the proper path. So far no problem When...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
3
by: MrNobody | last post by:
Ok, so I'm absoultely positive this was working last night, but today I'm getting this error in my program when I try to add a child node to a parent node of a tree... The error says: ...
3
by: Arthur Dzhelali | last post by:
I am trying dynamically create controls and add them to the form on the Separate thread. I know that I have to use delegate in order to update preexisting controls on the form, but when I ma...
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
2
by: MIke Brown | last post by:
Hello all, I've been searching for a solution on google for a problem related to creating events from a worker thread, with no luck.. Basically, the problem is when my events are caught by a...
3
by: Toe Dipper | last post by:
In short we have a lengthy process when a form is loaded that adds activex controls to our windows form. This process in itself works fine however we would like to push this processing to a thread...
0
by: Steve K. | last post by:
I understand the concepts and rules for invoking UI methods from a non-UI thread. In the past I have always checked with the control's InvokeRequired property and Invoked my delegate accordingly. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.