Results 1 to 2 of 2

Thread: Winsock Problem!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    1

    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:
    1. Private Sub Form_Load()
    2. Dim winsock As String
    3. winsock.localport = 15151 'on the local machine try to use ports between 3000 and 50000
    4. 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

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.  With Winsock
    5.     .RemoteHost = "finance.lycos.com"
    6.     .RemotePort = 80
    7.     .Close
    8.     .Connect
    9.  End With
    10. End Sub
    11.  
    12. Private Sub Winsock_Connect()
    13.     Winsock.SendData "GET /qc/stocks/quotes.aspx?symbols=INTC" & Chr(10)
    14. End Sub
    15.  
    16. Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
    17. Dim X As String
    18.     Winsock.GetData X
    19.     Debug.Print X
    20. End Sub
    21.  
    22. 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)
    23. Debug.Print "Error "; Description
    24. 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
  •  



Click Here to Expand Forum to Full Width