3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to make a simple chat program in visual basic using the Microsoft Winsock Control

Step 7Using the program/Conclusion

Using the program/Conclusion
ok now im going to tell you how to use the program

in visual basic click file then make project1.exe save it to your desktop
if there are any errors leave a comment and i will try to help you

now go to where you made the program and double click it twice and two programs should pop up
on one click host and on the other click connect and on the one you clicked host on it should say: Connected to: 127.0.0.1

now type in a name for both of them and you can send messages between the two

it works on LAN and it might work on WAN but im not sure


leave comments letting me know how i did or if you have questions or if you just feel like it
if you liked it or didn't like it rate it
« Previous StepDownload PDFView All StepsNext Step »
61 comments
1-40 of 61next »
Apr 14, 2012. 11:07 PMCorliansa says:
there is this word in front = "Run-Time Error '40006';
Apr 14, 2012. 10:37 PMCorliansa says:
I can't when i click "Send" button it give this message = "Wrong Protocol Or Connection State For The Requested Transaction Or Request" can you fix it?
Sep 29, 2011. 5:32 AMMochamaddhany says:
I have run-time error "40020" invalid operation at current state
Jul 19, 2011. 8:37 AM2?@8A:5 says:
is it working in WAN i mean like skype or MSN?
Jun 16, 2011. 7:53 AMmsörhäll says:
I need help.
EVERYTHING is working fine, but I want it so when you're active in the txtSend window, and press Enter/Return, it's the same as clicking Send.

So, when I click enter, it will send the message I've typed in the txtSend box.

Thanks!
Apr 6, 2011. 11:55 PMjeff032690 says:
i have an error...kindly please help me..
Argument not optional

Private Sub CMDSEND_Click()
Me.SCKMAIN.SendData = "(" & Me.TXTNAME.Text & ")" & Me.TXTSEND.Text

Apr 10, 2011. 7:41 PMjeff032690 says:
yes..
Apr 10, 2011. 10:26 PMjeff032690 says:
then what should i do..?
Feb 24, 2009. 6:13 PMjustin.samoisette says:
i tried adding Microsoft Winsock but it wasn't in the list. what do i do??
Mar 11, 2011. 5:50 AMjflores-3 says:
find it fin and find until you find it
Dec 10, 2008. 5:15 AMkevin-a101 says:
PS...im using Visual basic 2008 or 2005...ones at school ones at home (2008).. if u can give me a link to download vb 6.0 i would gladly install that if it helps
Dec 10, 2008. 12:26 PMkevin-a101 says:
ok i have no problem getting it im buying it i should have it in a little but..like i said im probably gonna need you to teach me some stuff im new with connecting the program to servers
Dec 10, 2008. 1:08 PMkevin-a101 says:
ok still downloading but as u can see im monitering posts
Dec 12, 2008. 5:43 AMkevin-a101 says:
ok that failed but i managed to find winsock control in both 2005 and 2008 so would i be able to do it from there?
Nov 23, 2010. 5:06 AMarjun866 says:
during making .exe file, there is an compile error "variable not defined" on line sckClose. how can i elliminate this
Dec 12, 2008. 5:56 AMkevin-a101 says:
ive also managed to put it in my toolbox aand add it to a form if u want i can tell u how so u can tell everyone else 6.0 is basically impossible to get now and 2005 and 2008 are available free as express editions
Dec 15, 2008. 5:41 AMkevin-a101 says:
okay hold on srry i havent been on in a while been trying to implement this chat program to see if it works in 2008 and 2005...it does...in order to do it u have to go into tools then choose toolbox items...then a screen pops up with 2 tabs click com componentsthen scroll down to find "microsoft WinSock Control 6.0 (sp4)
Dec 17, 2008. 5:10 AMkevin-a101 says:
ok im gonna start typnig in next comment cant see what im typing its too far over
Nov 4, 2010. 7:24 AMnadimos15 says:
hello there twinglish i did all the steps and everything seems to be ok except for the last step when i double click on project1 , an empty vb window appears i click on run tab then start to run the program , the program runs but only one appears not 2 as u mentioned so whats the problem so far ? thank u so much
Jun 2, 2010. 6:09 AMpallabi says:
 hii...i am trying to make a chat application in my website which is unde construction....i tried urs but unfortunately it s showing "runtime error 404"...............help me...its urgent
Nov 16, 2009. 12:14 AMkamal123joshi says:
I make this then programm and also maked its .exe but if i use or connect  it  to the another lan computer then it will show an error.
I maked sure to me as i maked and use it as same of  the illustrated on this site after but when i use it , it will show a error. please try to fix this!!!!! 
error:-

run time error '424'
object required
Sep 22, 2009. 3:54 AMkillertez says:
hi i am having the same problems as blite7777 can i send the program to u and i can tell me what i did wrong
Jul 31, 2009. 5:08 AMblite777 says:
sigh....there is an error on Private Sub cmdSend_Click() codes.. i exactly wrote the corrected code u wrote... its giving me this message "run time error '40006': Wrong protocol and connection state for the requested transaction or request" my protocol was 1324 and i also tried alot protocols.. i dnt know wat i am doing ronng.. plz help me :) tahnks for the nice tutorilal :)
Sep 4, 2009. 5:23 PMCatch_22_ says:
I'm getting that too.. Well the code runs fine some I'm guessing its a logic error? Ill run back over the code again but I'm stuck.
Feb 5, 2009. 11:07 PMjhors12 says:
what is the meaning of invalid outside procedure
Feb 5, 2009. 11:08 PMjhors12 says:
coz i get a compile error
Jan 7, 2009. 9:15 AMkevin-a101 says:
wow i figured out the problem i fixed it it works when the program tried to connect it had the wrong ip that ip works on your cpu because thats your ip when you host a connection the ip on the computer your working on is used as your local ip and when u connect winsock uses the ip inputed when both match the connection is established the reason why when i sent the beta to yu it said listening....connecting, connected, connection closed only on the one trying to connect is because it was trying to connect it latched on to the inputed ip but no program match was found so the connection was closed...wow im exited i can now start the main idea of my project im gonna test it at home as well to see if it works if it does ill finish the code and send it to you...thanks alot
1-40 of 61next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
2
Author:twenglish1
i love working with electronics and computers, playing video games, and i love to play with fire, HACKING!!!!