prob

  • Acceptu2
  • Born
  • Born
  • Acceptu2
  • Posts: 2
  • Loc: north yorkshire

Post 3+ Months Ago

hey all i am new to this forum i made a name Acceptu and i put the ronge email is oops well i made another acount Acceptu2 with the right one and i am here hope you can help me the picture should explane it all . . .. . . . .. . . .
Image
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I don't know anything about this stuff, but you have WERE instead of WHERE
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

I haven't used VB since school, but from the error message it sounds like the variable isn't in scope in that procedure. I'm wondering where you declared it. Is it a form-level variable in the General Declarations section of frmChat or a global in one of your code modules?
  • Acceptu2
  • Born
  • Born
  • Acceptu2
  • Posts: 2
  • Loc: north yorkshire

Post 3+ Months Ago

here is my frame code i have looked over it over and over
if you are wondering the user name pass and cd key are to connect to westwood i will say no more about that

the chat is pc to pc totaly seppret

Code: [ Select ]
Option Explicit
Dim NumSockets As Integer
Dim SysMsg As String
Private Sub Cnt_Click()
' Tells Sender to connet to the IP which is connected to Reciever
Sender.RemoteHost = "" & HisIP.Caption & ""
Sender.RemotePort = 8888
Sender.Connect ' Connect's Sender ofcourse
SysMsg = "Connected ..."
lstChat.AddItem (SysMsg)
' These labels tell user which IP he is connected to
Label2.Visible = True
HisIP.Visible = True
Cnt.Visible = False
End Sub
Private Sub Command1_Click()
' Disconnect
SysMsg = " Disconnected ... "
lstChat.AddItem (SysMsg)
Sender.Close
End Sub
Private Sub Form_Load()
Select Case strChatMode
Case "MAKE"
Make
Case "JOIN"
Join
End Select
frmChat.Caption = "Acceptu chat 1.2" & strHandle & " and Date is " & Month(Now) & "/" & Day(Now) & "/" & Year(Now) & ""
End Sub
Private Sub Make()
' Event's to follow when user chooses to make a Chatroom
SysMsg = "Made a ChatRoom; IP:" & Sender.LocalIP & ""
lstChat.AddItem (SysMsg)
Reciever(0).LocalPort = 9999 'Set's the Port to which to listen to
Reciever(0).Listen
End Sub
Private Sub Join()
' Event's to follow when user chooses to Join a Chatroom
Sender.RemoteHost = "" & strJoinIP & ""
Sender.RemotePort = 9999 ' Sets the port on which Sender will connect to Reciever of other client CAUTION: KEEP THE PORT OF maker's Reciever and joiners sender same , vice versa
Sender.Connect
Reciever(0).LocalPort = 8888
SysMsg = "Joined ChatRoom with IP " & strJoinIP & ""
lstChat.AddItem (SysMsg)
Reciever(0).Listen
End Sub
Private Sub Reciever_Close(Index As Integer)
SysMsg = "Disconnected"
lstChat.AddItem (SysMsg)
' Action to be taken in event of disconnection
Reciever(Index).Close
Unload Reciever(Index)
NumSockets = NumSockets - 1
End Sub
Private Sub Reciever_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
NumSockets = NumSockets + 1
Load Reciever(NumSockets)
Reciever(NumSockets).Accept requestID ' Accept the connection request
HisIP.Caption = Reciever(NumSockets).RemoteHostIP ' Set the value to HisIP label to the IP which is connected to Reciever
SysMsg = "Reciever has accepted connection request..."
lstChat.AddItem (SysMsg)
If strChatMode = "MAKE" Then
' If user has made chatroom then make Connect command visible
Cnt.Visible = True
SysMsg = "Please click on connect to connect to the joiner ..."
lstChat.AddItem (SysMsg)
End If
End If
End Sub
Private Sub Reciever_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strData As String
Reciever(Index).GetData strData, vbString ' Gets data( chat message ) from the other client
lstChat.AddItem (strData)
End Sub
Private Sub Send_Click()
Dim strSend As String
' Joins Handle and Message
strSend = "" & strHandle & ":" & txtSend.Text & ""
' Sends Chat Message
Sender.SendData strSend
' Add the message to our lstChat
lstChat.AddItem (strSend)
txtSend.Text = ""
End Sub
  1. Option Explicit
  2. Dim NumSockets As Integer
  3. Dim SysMsg As String
  4. Private Sub Cnt_Click()
  5. ' Tells Sender to connet to the IP which is connected to Reciever
  6. Sender.RemoteHost = "" & HisIP.Caption & ""
  7. Sender.RemotePort = 8888
  8. Sender.Connect ' Connect's Sender ofcourse
  9. SysMsg = "Connected ..."
  10. lstChat.AddItem (SysMsg)
  11. ' These labels tell user which IP he is connected to
  12. Label2.Visible = True
  13. HisIP.Visible = True
  14. Cnt.Visible = False
  15. End Sub
  16. Private Sub Command1_Click()
  17. ' Disconnect
  18. SysMsg = " Disconnected ... "
  19. lstChat.AddItem (SysMsg)
  20. Sender.Close
  21. End Sub
  22. Private Sub Form_Load()
  23. Select Case strChatMode
  24. Case "MAKE"
  25. Make
  26. Case "JOIN"
  27. Join
  28. End Select
  29. frmChat.Caption = "Acceptu chat 1.2" & strHandle & " and Date is " & Month(Now) & "/" & Day(Now) & "/" & Year(Now) & ""
  30. End Sub
  31. Private Sub Make()
  32. ' Event's to follow when user chooses to make a Chatroom
  33. SysMsg = "Made a ChatRoom; IP:" & Sender.LocalIP & ""
  34. lstChat.AddItem (SysMsg)
  35. Reciever(0).LocalPort = 9999 'Set's the Port to which to listen to
  36. Reciever(0).Listen
  37. End Sub
  38. Private Sub Join()
  39. ' Event's to follow when user chooses to Join a Chatroom
  40. Sender.RemoteHost = "" & strJoinIP & ""
  41. Sender.RemotePort = 9999 ' Sets the port on which Sender will connect to Reciever of other client CAUTION: KEEP THE PORT OF maker's Reciever and joiners sender same , vice versa
  42. Sender.Connect
  43. Reciever(0).LocalPort = 8888
  44. SysMsg = "Joined ChatRoom with IP " & strJoinIP & ""
  45. lstChat.AddItem (SysMsg)
  46. Reciever(0).Listen
  47. End Sub
  48. Private Sub Reciever_Close(Index As Integer)
  49. SysMsg = "Disconnected"
  50. lstChat.AddItem (SysMsg)
  51. ' Action to be taken in event of disconnection
  52. Reciever(Index).Close
  53. Unload Reciever(Index)
  54. NumSockets = NumSockets - 1
  55. End Sub
  56. Private Sub Reciever_ConnectionRequest(Index As Integer, ByVal requestID As Long)
  57. If Index = 0 Then
  58. NumSockets = NumSockets + 1
  59. Load Reciever(NumSockets)
  60. Reciever(NumSockets).Accept requestID ' Accept the connection request
  61. HisIP.Caption = Reciever(NumSockets).RemoteHostIP ' Set the value to HisIP label to the IP which is connected to Reciever
  62. SysMsg = "Reciever has accepted connection request..."
  63. lstChat.AddItem (SysMsg)
  64. If strChatMode = "MAKE" Then
  65. ' If user has made chatroom then make Connect command visible
  66. Cnt.Visible = True
  67. SysMsg = "Please click on connect to connect to the joiner ..."
  68. lstChat.AddItem (SysMsg)
  69. End If
  70. End If
  71. End Sub
  72. Private Sub Reciever_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  73. Dim strData As String
  74. Reciever(Index).GetData strData, vbString ' Gets data( chat message ) from the other client
  75. lstChat.AddItem (strData)
  76. End Sub
  77. Private Sub Send_Click()
  78. Dim strSend As String
  79. ' Joins Handle and Message
  80. strSend = "" & strHandle & ":" & txtSend.Text & ""
  81. ' Sends Chat Message
  82. Sender.SendData strSend
  83. ' Add the message to our lstChat
  84. lstChat.AddItem (strSend)
  85. txtSend.Text = ""
  86. End Sub

Quote:
could you get the atachment mod?
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

Did you declare strChatMode in the General Declarations section of one of your code modules? If you have, is it declared as Public strChatMode as String so that it will be visible to all procedures?

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 73 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.