RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 3130 | Replies: 4
Reply
Join Date: Jun 2005
Posts: 2
Reputation: dancraggs is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dancraggs dancraggs is offline Offline
Newbie Poster

Winsock connection problem

  #1  
Jun 14th, 2005
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!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Posts: 41
Reputation: mrmike is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
mrmike mrmike is offline Offline
Light Poster

Re: Winsock connection problem

  #2  
Jun 15th, 2005
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
Reply With Quote  
Join Date: Jun 2005
Posts: 2
Reputation: dancraggs is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dancraggs dancraggs is offline Offline
Newbie Poster

Re: Winsock connection problem

  #3  
Jun 15th, 2005
I read about that in a few places. I'll give it a shot, thanks
Reply With Quote  
Join Date: Jun 2005
Location: Texas
Posts: 120
Reputation: jwshepherd is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
jwshepherd's Avatar
jwshepherd jwshepherd is offline Offline
Junior Poster

Re: Winsock connection problem

  #4  
Jun 16th, 2005
Are you tring the Winsock1_DataArrival method?
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 108
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: Winsock connection problem

  #5  
Jun 16th, 2005
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:50 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC