VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error
VB6 - RemoteHostIp error VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
Go Back  Xtreme Visual Basic Talk > > > VB6 - RemoteHostIp error


Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2011, 05:04 AM
maharaskal maharaskal is offline
Newcomer
 
Join Date: Dec 2006
Posts: 3
Default VB6 - RemoteHostIp error


Can anyone guide me on this
im still new for VB6
this is not my coding anyway i just trying to modify
the actual one will search the room using the port
but i wanted to change to search by the RemoteHostIp.

kindly guide me to fix it
Code:
Private Sub Command3_Click()
    On Error Resume Next
' i made this change but cant get the result :(
    RemoteHostIP = InputBox("cool..")
    If RemoteHostIP = RemoteHostIP Then
    NewRoom Tmp, "Custom Room (Room " & Tmp & ")"
    Else
        MsgBox "Invalid room or blank!"
    End If
   
'this is the original code.

  '  Tmp = InputBox("Please enter a room number to connect to", "Join Custom Room")
   ' If Tmp = RemoteHostIP Then  ' > 0 And Tmp <> 3155 And Tmp <> 1113 Then
      '  NewRoom Tmp, "Custom Room (Room " & Tmp & ")"
  '  Else
     '   MsgBox "Invalid room or blank! Cannot be 3155 or 1113", vbExclamation, "Bad Room Number"
   ' End If

End Sub
--=-=-=-=-=-=-=-=-=

' Original code for the Room which use in the Module code as below

' This is for handling of the room data and other stuff

Option Compare Text
' The latest user to enter NChat
Public NewUser As String
' The room's welcome message
Public WelcomeMsg As String
' The name of the room you are in
Public RoomName As String
' Your room description
Public Description As String
' Have you created your own room?
Public CreatedRoom As Boolean
' How long your room has been running
Public RoomTime As Long
' Your room "ID" (Port)
Public RoomID As Long
' Umm.... I think this is the same as above. Don't
' ask why. It just is...
Public Room As Long
Public RoomHost As String
' The password for any newly created rooms
Public Password As String


Public Sub NewRoom(ByVal RoomPort As Long, Optional RoomN As String, Optional Silent As Boolean)
' New Room is actually a port change.
' This may interfere with other applications, but
' That aint my fault :P
    On Error Resume Next
    DoEvents
    
    ' If your on a server, then don't allow room changes, because this
    ' could be a security risk
    If IsInternet = True Then
        MsgBox "Cannot change rooms! Your on a server! Disconnect from the server (From the main menu) and try again" _
            , vbCritical, "Unable to change rooms!"
        Exit Sub
    End If
    
    ' No use in disconnecting yourself if no
    ' username has been set
    If UserName > "" Then
        Broadcast "disø" & UserName
        DoEvents
        DoEvents
    End If
    ' Resets your "Created room" status
    CreatedRoom = False
    Password = ""

    DoEvents

    DoEvents
    Room = RoomPort
    ' Clear the user list and welcome message
    frmMain.List1.ListItems.Clear
    WelcomeMsg = ""
    Description = ""
    ' Rests the connection, but this time with
    ' the Room ID as the port

    frmMain.sckUDP.Close

    frmMain.sckUDP.RemoteHost = Address
    frmMain.sckUDP.RemotePort = RoomPort
    frmMain.sckUDP.LocalPort = frmMain.sckUDP.RemotePort



    If UserName > "" Then
        Broadcast ("conø" & MyIcon & "ø" & sckUDP.LocalIP)
        DoEvents
        DoEvents
        Text "+username+ has entered the conversation..." & vbCrLf, "con", True, , , , "Center"
    End If

    DoEvents
    If RoomN = "" And Silent = False Then
        Text "  >> Connected to Room #" & RoomPort & ". Enjoy!" & vbCrLf, "con", True
    ElseIf RoomN > "" And Silent = False Then
        Text "  >> Connected to " & RoomN & " (Room #" & RoomPort & ") Enjoy!" & vbCrLf, "con", True
        RoomName = RoomN
    End If

    ' Silent doesn't tell you when you have changed rooms
    DoEvents
    ' Add your name, and let the rest of the room know
    ' you have arrived
    frmMain.List1.ListItems.Add 1, frmMain.sckUDP.LocalIP, UserName, , frmMain.ImageList1.ListImages.Item(FindIcon(MyIcon)).Key
    DoEvents
    DoEvents

End Sub

Last edited by Cerian Knight; 04-18-2011 at 01:36 PM. Reason: Added [code]...[/code] tags and wrapped long line
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
 
VB6 - RemoteHostIp error
VB6 - RemoteHostIp error
 
-->