By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,905 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,905 IT Pros & Developers. It's quick & easy.

threading help please -- events never get called

P: n/a
Hello,

I have this loop in a function

System.Threading.ThreadPool.SetMaxThreads(4, 4)

For Each row As DataGridViewRow In DataGridView1.Rows
If Not row.Cells(0).Value Is Nothing Then
Dim user As New myUser(row.Cells(0).Value,
row.Cells(1).Value)
System.Threading.ThreadPool.QueueUserWorkItem(Addr essOf
doMessageRequest, user)
End If

Next

and outside the function I have this:

Dim WithEvents user As myspaceUser
Private Sub Success() Handles user.actionSuccess
Dim sent As Int32 = Convert.ToInt32(lblSent.Text)
Dim totalIds As Int32 = Convert.ToInt32(lblTotalIds.Text)
sent += 1
totalIds += 1
lblTotalIds.Text = totalIds
lblSent.Text = sent

End Sub
Private Sub Failure() Handles user.actionFailure
Dim totalIds As Int32 = Convert.ToInt32(lblTotalIds.Text)
totalIds += 1
lblTotalIds.Text = totalIds
End Sub

which neither seem to get called. Can someone tell me what I'm doing
wrong? I have a the raisevent actionSuccess in my code. here:
Catch ex As Net.WebException
RaiseEvent actionFailure()
Catch sex As IO.IOException
RaiseEvent actionFailure()
End Try
RaiseEvent actionSuccess()


arian

Aug 23 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.