|
-
Aug 10th, 2005, 07:57 PM
#1
Thread Starter
New Member
Winsock Problem!!!
Hey,
I am still new to VB6, and very new to winsock, but I am making a chat client for my year 11 SDD (Software Design & Development) and I am having a problem with winsock.
Just a quick note: I have read / searched through all the posts on the forum including reading code posted on how to make a chat client but I am still having this problem.
The problem I am having is that winsock brakes down into smaller "objects" such as:
Winsock.listen
Winsock.localport
etc.
I can delcare winsock itself fine, but when it comes to delcaring the actual defined version of winsock ( e.g winsock.locaport ) I can’t do this, I never thought I would have to / You can declare sub variables but whatever help you guys could give would be greatly aprricated.
VB Code:
Private Sub Form_Load()
Dim winsock As String
winsock.localport = 15151 'on the local machine try to use ports between 3000 and 50000
winsock.listen ' start listening for incoming connections
The error I get is :
Complie Error - Invalid Qualifier
And when i declare winsock as data ( Which from what i have seen you have to do. )
I get the error:
Complie Error - Method or data member not found.
Thanks in advance.
Regards,
Josh
-
Aug 10th, 2005, 08:02 PM
#2
Re: Winsock Problem!!!
I'll post a project. You may not have Winsock on your system. You would have to Google it. This will tell you. If it works, you know you have it, and can look to see what is selected in components.
http://vbforums.com/attachment.php?attachmentid=38218
VB Code:
Option Explicit
Private Sub Command1_Click()
With Winsock
.RemoteHost = "finance.lycos.com"
.RemotePort = 80
.Close
.Connect
End With
End Sub
Private Sub Winsock_Connect()
Winsock.SendData "GET /qc/stocks/quotes.aspx?symbols=INTC" & Chr(10)
End Sub
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim X As String
Winsock.GetData X
Debug.Print X
End Sub
Private Sub Winsock_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Debug.Print "Error "; Description
End Sub
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
|