|
-
Jan 18th, 2012, 12:01 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Threading Problems
Hello
I have a little problem with threads that it's driving me crazy...
I have this application, that when it starts it needs to check some files in hard drive, check some info from the database, and other things where the user doesn't need to interact, i created some threads in the constructor of the main form to handle this job, but i don't understand why, when i try to run some of the threads (didn't figured out if all or some specific), the code of the constructor runs from the start again...
There's a problem when trying to run multiple threads? I already tried the background worker, the thread class and the result it's always the same...
By the way, i have a splash screen that runs in another thread to update the messages.
The code it's similar to this:
vb.net Code:
Public Sub New()
InitializeSplashScreen()
SplashS.UpdateMessage("First Task...")
...
other tasks in the same thread
...
SplashS.UpdateMessage("First thread...")
ThreadUpdateModels()
...
...
End Sub
vb.net Code:
Private Sub ThreadUpdateModels()
Dim thr As New Thread(AddressOf GeralPDM.GetLatestVersion)
With thr
.IsBackground = True
.Start()
End With
End Sub
Some of the functions used by the threads use other functions than the one called directly from the class, is this the problem?
Can i inside a thread call a another thread, i have a situation that i need to check if a connection it's on, before getting the data, so i use another thread?
Thanks
Rate People That Helped You
Mark Thread Resolved When Resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|