Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 3130 | Replies: 4
![]() |
•
•
Join Date: Jun 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi there! I'm having some trouble with the Winsock control. I'm trying to connect to a POP3 server. Problem is, I have the winsock.Connect function, then the DataReceived event SHOULD be called (the POP3 welcome message upon connection), and then after the Connect function I have other things that read the welcome message (basically checking it's '+OK' and we can continue). So it looks similar to:
winsock.Connect
' Data received here hopefully, and written to recddata
If Left(recddata, 3) = "+OK" Then.... etc.
But, my problem is that it just skips completely past winsock.Connect, doesn't write anything to the data variable, and just goes on to the next line. However, if I put, say, an MsgBox function in the DataReceived event, and nothing after the Connect function, it connects, and displays the welcome message.
So, basically, whenever there's something after the Connect function, it seems to skip the function altogether. DoEvents doesn't make a difference, and a loop doesn't want to work either. Is there a way to just wait until it's Connected and the welcome message has been received?
Thank you so much in advance!!
winsock.Connect
' Data received here hopefully, and written to recddata
If Left(recddata, 3) = "+OK" Then.... etc.
But, my problem is that it just skips completely past winsock.Connect, doesn't write anything to the data variable, and just goes on to the next line. However, if I put, say, an MsgBox function in the DataReceived event, and nothing after the Connect function, it connects, and displays the welcome message.
So, basically, whenever there's something after the Connect function, it seems to skip the function altogether. DoEvents doesn't make a difference, and a loop doesn't want to work either. Is there a way to just wait until it's Connected and the welcome message has been received?
Thank you so much in advance!!
•
•
Join Date: May 2005
Posts: 41
Reputation:
Rep Power: 4
Solved Threads: 0
best solution I can give is to try socketwrench from catalsyt.
this was mentioned to me by comatose as I was having problems with a project I was doing, and found that it helped me do what i want it to do.
http://www.catalyst.com
the addin is also free and you can download a help document on it as well
this was mentioned to me by comatose as I was having problems with a project I was doing, and found that it helped me do what i want it to do.
http://www.catalyst.com
the addin is also free and you can download a help document on it as well
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 108
If you look in the tutorial's sections of this forum (VB tutorials) there is a tutoral I wrote on how to connect to a pop3 server using VB.... here is that link:
http://www.daniweb.com/tutorials/tutorial20424.html
http://www.daniweb.com/tutorials/tutorial20424.html
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode