Results 1 to 5 of 5

Thread: May be a tougher one!

  1. #1

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Wink

    Hi there!
    Does anybody know what is the best way to communicate between VB programs in a LAN(win9x)? Should I use Winsock for that? or any other method is there? I dont know anything abt Winsock programming. Please help me or guide me.
    Jeba.
    PS. Please provide code if u have.
    J£ßä

  2. #2
    Member
    Join Date
    Jun 2000
    Location
    Gainesville, Ga
    Posts
    50

    Map

    Maybe this will help some it shows how to map a drive.

    http://forums.vb-world.net/showthrea...threadid=21174
    Scott Cato
    VB6s

  3. #3
    Member
    Join Date
    Jun 2000
    Location
    North of France
    Posts
    49

    Arrow

    Try the Winsock control, here is an example of a project i made :

    Code:
    ' CLIENT
    
    
    Private Sub DeconnectCommand_Click()
        tcpClient.Close
    End Sub
    
    Private Sub ConnectCommand_Click()
        On Error GoTo CheckError
        
        tcpClient.RemoteHost = PostText                  ' "XXX.XXX.XXX.XXX"
        tcpClient.RemotePort = 1001
    
        If tcpClient.State = sckConnecting Then
            ErrorText.Text = "connecting..."
        Else: tcpClient.Connect
        End If
        Exit Sub
    CheckError:
        Call ProcessError
    End Sub
    
    
    '******************************************************************************
    '                           NETWORK
    '******************************************************************************
    
    
    Private Sub SendData(Message As String)
        On Error GoTo CheckError
        tcpClient.SendData Message
    Exit Sub
    CheckError:
        Call ProcessError
    End Sub
    
    Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
        tcpClient.GetData StrData
        If StrData = "E53" Then
            ErrorText.Text = "Appli doesn't exist on the server"
        Else: MsgBox "Error n° " & Right(StrData, Len(StrData) - 1)
        End If
    End Sub
    
    Private Sub tcpClient_Close()
        ErrorText.Text = "Server disconnected!"
        Beep
        tcpClient.Close
    End Sub
    
    'SERVER
    
    
    Private NumCanal As Integer
    
    Option Explicit
    
    Private Sub Form_Load()
        NumCanal = 0
        tcpServer(0).LocalPort = 1001
        tcpServer(0).Listen
    End Sub
    
    Private Sub tcpServer_ConnectionRequest(index As Integer, ByVal requestID As Long)
        If index = 0 Then
            NumCanal = NumCanal + 1
            Load tcpServer(NumCanal)
            tcpServer(NumCanal).LocalPort = 0
            tcpServer(NumCanal).Accept requestID
            tcpServer(NumCanal).SendData ("Ack")
        End If
    End Sub
    
    Private Sub tcpServer_DataArrival(index As Integer, ByVal bytesTotal As Long)
        On Error GoTo CheckError
        tcpServer(index).GetData StrData
        Exit Sub
    CheckError:
        tcpServer(index).SendData ("E" & Err.Number)
    End Sub
    With this, you can connect several clients to the server and disconnect both from client and server (as you want!)


    Hope this help!

    [Edited by (B2F)Tom on 07-11-2000 at 02:38 AM]
    Hi-Tech Engineer

  4. #4

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Cool one more thing!

    Hi Tom!
    Thanx man! I will try that.
    Can u give me a link for a winsock tutorial page(of course...for a beginner)? coz I have zero knowledge in winsock...
    Jeba.
    J£ßä

  5. #5
    Member
    Join Date
    Jun 2000
    Location
    North of France
    Posts
    49
    Hi-Tech Engineer

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