|
-
Jun 13th, 2006, 12:37 AM
#1
Thread Starter
Lively Member
[02/03] RaiseEvent Problem ?
VB Code:
Public Sub processDocument()
Dim document As String
Dim documentBuilder As StringBuilder
If documents.Count <> 0 Then
documentBuilder = documents(0)
document = documentBuilder.ToString
documents.RemoveAt(0)
If document.IndexOf("<auth") >= 0 Then
RaiseEvent AuthRecieved(documentBuilder)
End If
End If
End Sub
Under my Windows Form Designer, i added
AddHandler App.network.AuthRecieved, AddressOf Me.FPD
I got 2 Page, the first page is a login, and it uses the raiseevent as well, the second page does receive the auth tag too.
But it can't proceed on to AddressOf Me.FPD, for my login page, the AddHandler thingy work and i manage to execute the method.
Any help ?
Last edited by Winder; Jun 13th, 2006 at 04:23 AM.
Reason: RaiseEvent Problem ?
-
Jun 13th, 2006, 02:51 AM
#2
Re: [02/03]
Hi,
The way you started your thread isn't the way it should be.
1. What's your problem? Write your question next to the version you mentioned.
2. What do you want your code should be doing.
Wkr,
sparrow1
-
Jun 13th, 2006, 04:28 AM
#3
Thread Starter
Lively Member
Re: [02/03] RaiseEvent Problem ?
VB Code:
Private _processorThread As Thread
Public Sub New(ByVal clientSocket As Socket)
Me.clientSocket = clientSocket
Me.documents = New ArrayList(10)
Me.response = New StringBuilder
_processorThread = New Thread(New ThreadStart(AddressOf processDocument))
_processorThread.Priority = ThreadPriority.Lowest
_processorThread.Start()
End Sub
VB Code:
Public Sub processDocument()
Dim document As String
Dim documentBuilder As StringBuilder
If documents.Count <> 0 Then
documentBuilder = documents(0)
document = documentBuilder.ToString
documents.RemoveAt(0)
If document.IndexOf("<auth") >= 0 Then
RaiseEvent AuthRecieved(documentBuilder)
End If
End If
End Sub
This is a program, the moment it receive an Auth tag from the server, it will RaiseEvent, the Add Handler is on another page which i implemented.
AddHandler AuthReceived, AddressOf Me.<MethodName>
But the problem, i have 2 sectors of the forms, both forms require <auth> tag from the server, but i can't seem to process the second form as the first form already raise the event, how do i solve this ?
Thank you.
-
Jun 13th, 2006, 07:49 PM
#4
Thread Starter
Lively Member
Re: [02/03] RaiseEvent Problem ?
Basically i have a thread which is always check for auth tag coming in, but i got 2 forms which requires the auth raiseevent, the first login page works but the second page which require the auth event doesn't work.
Anyone can guide me on this ?
Do i have to removehandler or is there something to down an event ?
-
Jun 14th, 2006, 03:13 AM
#5
Thread Starter
Lively Member
Re: [02/03] RaiseEvent Problem ?
-
Jun 14th, 2006, 10:20 PM
#6
Thread Starter
Lively Member
Re: [02/03] RaiseEvent (Handler Stuff) ?
Erm...
For example if i have 2 handler
Addhandler AuthRecieved, AddressOf Me.Login (This is in LOGIN Page)
Another 1 in another FORM
Addhandler AuthRecieved, AddressOf Me.check
The Raise Event is
VB Code:
If document.IndexOf("<auth") >= 0 Then
RaiseEvent AuthRecieved(documentBuilder)
End If
As long the document.IndexOf("<auth") is valid, it will raise the event, BUT i run this on LOGIN Page once and it works, but when i reach the next screen, and i tried receiving the <auth> tag from the server, it simply just don't run my second handler which has the check() method.
Can someone help ? Please ?
Thank you
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
|