Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 13th, 2007, 5:11 AM   #1
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
problem with my chat client

i am having trouble with my chat client it is coming up and saying unsupported variant type.

so here is my code i have.

Private Sub bntSend_Click()
On Error GoTo t
sock1.SendData txtSend
txtLog = txtLog & "Client : " & txtSend & vbCrLf
Exit Sub
t:
MsgBox "Error : " & Err.Description
sock1_Close
End Sub

that is the code that is causing the problem.

it is the code that sends the text you typed to the other person and that is when the error comes up and when the error comes up it disconnects you from the server.

when you open the client program the ip and port in there is the server i have for the program to run on or you could open the server program and use your computer as the server.

and this is coded in visual basics 6

here is the download too for the server and client
Attached Files
File Type: zip Chat Client.zip (11.9 KB, 21 views)
__________________
Demon101 Production's

Code Forums
demon101 is offline   Reply With Quote
Old Mar 13th, 2007, 3:19 PM   #2
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
well i sat down and went through all my coding and it working now



here is the working version of my chat client/server
Attached Files
File Type: zip Chat Client.zip (12.4 KB, 16 views)
__________________
Demon101 Production's

Code Forums
demon101 is offline   Reply With Quote
Old Mar 13th, 2007, 7:18 PM   #3
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 171
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
my Suggestion, DO NOT USE GOTO statements. If you do I will make a program for you, that will be goto statement after goto statement, etc. They make your code look ugly. If you want to use error handling use exceptions, if you don't want to use exceptions then use if statements, just not goto statements. Help keep the world sane.
PhilBon is offline   Reply With Quote
Old Mar 13th, 2007, 7:25 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Goto statements, while not inherently evil, generally are a sign of a coder who has not mastered the simplicities of loops and branching constructs. While their equivalent (branches/jumps) are an integral part of assembly-language programming, you will find that they are often automatically provided by higher-level languages in the form of block delimiters (end statements, opening and closing parentheses, etc.).

The first line of attack is to realize that you're needlessly complicating matters and causing untold tons of grief to those who follow and maintain. None of that matters, of course, if you have no intention of being a pro or of disseminating your code, or of asking for help.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 15th, 2007, 10:35 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
Unfortunately, using GoTo is basically the only way of handling errors in Visual Basic. My recommendation would be to switch to Visual Basic .NET (now Visual Basic 2005), but that requires a lot of hard work, especially if you need to port a program.

Out of curiosity, how did you fix the problem?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Mar 15th, 2007, 10:46 AM   #6
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 159
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
the textbox on the program where you typed your stuff in before you hit the send button i forgot to rename the text box from

textbox1 to txtsend
__________________
Demon101 Production's

Code Forums
demon101 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Networkprogramming in Unix Xyhm C 2 Mar 18th, 2006 1:35 PM
Problem with FTP server/client Brent C++ 0 Nov 25th, 2005 11:50 AM
invalid literal problem driving me nuts cypherkronis Python 5 Jul 3rd, 2005 1:03 PM
Try capturing client text crashed!? Kam C++ 0 May 19th, 2005 1:31 AM
Freezing Applets Mjordan2nd Java 6 Apr 13th, 2005 5:07 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:26 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC