Results 1 to 3 of 3

Thread: winsock array - help needed.

  1. #1

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    winsock array - help needed.

    i created a multichat app with winsock array it seems to work fine.

    say i have 3 clients connected namely client1,client2 and client3 respectively.


    if client1 send private message to client2, it checks whether a private message window hasn't already been open with client1 on client2's machine. if not it opens a new window
    else
    it displays the data in the opened window.

    it works fine.

    now how do you do that with the server

    say client1 sends a message to the server machine, it must do the same thing as client2 machine above.

    i tried it it just keeps opening new window

    what do i do.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: winsock array - help needed.

    you've just asked a question which no-one could answer without guessing :-/

    You will need to post code, tell su the problems. screenshots etc.

    Pino

  3. #3

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: winsock array - help needed.

    VB Code:
    1. Private Sub wsckarr_DataArrival(ByVal lngIndex As Long, ByVal strData As String)
    2.  
    3. dim strMsgarr() as string
    4. dim NewPM as New frmPM
    5.  
    6. strMsgarr = split(strData, chr(59))   ' chr(59) here is ";" character without the quotation marks
    7.  
    8.             'Searches through the PM's to see if an open message is already open with the user
    9.             For i = 0 To 30
    10.                 If NewPM(i).Caption = strMsgarr(3) Then
    11.                     'If it is, it simply adds the text to that window, then exits this function
    12.                     strPMMsg = strMsgarr(1) & strMsgarr(3) & strMsgarr(2)
    13.                     NewPM(i).txtMessage.Text = strPMMsg
    14.                     Exit Sub
    15.                 End If
    16.             Next i
    17.             'If not, it simply adds the text, and pops open a new window.
    18.             NewPM(intPmCount).Caption = strMsgarr(3)
    19.                     strPMMsg = strMsgarr(1) & strMsgarr(2) & strMsgarr(3) & vbCrLf
    20.             NewPM(intPmCount).txtMessage.Text = strPMMsg
    21.             Load NewPM(intPmCount)
    22.             NewPM(intPmCount).Show
    23.             intPmCount = intPmCount + 1
    24.  
    25.  
    26. End Sub
    Last edited by modpluz; Nov 1st, 2005 at 08:47 PM.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

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