Hi,

I'm trying to write my first application using Winsock. I'm trying to retrieve the HTML code from a website. Here is what I have:

-------------------------------------------------
Dim WithEvents Winsock As MSWinsockLib.Winsock

Private Sub Form_Load()
With Winsock
.RemoteHost = "www.yahoo.com"
.RemotePort = 80
.Connect
.SendData "GET /"
End With
End Sub

Private Sub winsock_ondataarrival()
Dim rBuffer

rBuffer = Winsock.GetData
MsgBox rBuffer
End Sub
-------------------------------------------------

When I run it, I get:
'Run-time error '91': Object variable of With block variable not set'

When I click on 'Debug' it highlights the following line:
'.RemoteHost = "www.yahoo.com"'

Does anybody think they can point me in the right direction?
Thanks!
Tom