In this instuctable i will show you how to make a simple chat program in visual basic. i will go over what all the code does so you will be learning as you make it, and at the end i will show you how to use it.

Step 1: Overview

This program will let you exchange messages between two people on your same network. It may work if your not on the same network but i can't test it now.

You should have Microsoft Visual Basic 6.0, that is what i am using.
Basic programing knowledge is recommended

Lets get started!!!

open visual basic and create a Standard EXE
<p>I'm using visual studio 2013.</p><p>When I run the program, the following error message is given.</p><p>&quot;</p><p>An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in AxInterop.MSWinsockLib.dll<br><br>Additional information: Exception from HRESULT: 0x800A9C54&quot;</p><p>my email:dewmitha.mahiti@gmail.com</p><p>Please help me!</p>
<p>exe file not opend pls tell how to run the programe</p>
<p>Hi, how can it connect with other pc? And how can i make it so there are more that two people can chat it this?</p>
please send me the code i'm creating a system with chatbox tnx in advance jhordan.meneses@gmail.com
<p>please send me code at hackaholic08@gmail.com</p>
Hi, i am coding in VB2008, it worked so far but this part doesn't work @ all for me :<br/><br/> sckMain.state &lt;&gt; sckClose<br/><hr/><br/>sckMain.accept requestid<br/><hr/><br/>Please e-mail me with a solution asap as i really like this proggy u made! <br/>de7ox@hotmail.com <br/>Thanks!<br/>
I created a chat program without winsock and its works
<p>pls mail me the procedure and code .... nikkuraj786@gmail.com</p>
the correct code is:If sckMain.CtlState &lt;&gt; 0 Then<br> <br> sckMain.Accept(e.requestID)
how is it possible can you explain
How did you do it?
Dim proCedure As String<br> sckMain.Close()<br> sckMain.Accept(e.requestID)<br> sckMain.Accept(e.requestID)<br> proCedure = txtLog.Text &amp; &quot;Connected to: &quot; &amp; sckMain.RemoteHostIP &amp; vbCrLf<br> proCedure = txtLog.Text<br>you will need to fix the lines, but this is what I have.
Winsock1.Close() Winsock1.Accept(e.requestID)
i don't know how to get this program to work with VB2008 you need to make changes to the code, sorry
To everyone asking why it isnt working: this method only works on windows xp with microsoft visual basic 6!
<p>anyone know what is the problem??</p>
<p>didn't work for me. Am running window 10</p>
<p>didn't work for me. Am running window 10</p>
<p>Help me with runtime error &quot;object required&quot; 424 as soon as possible.</p>
<p>change the name property of txt2 into txtlog</p>
I need help here the program is running correctly but there is no lines between the messages help
<p>brilliant thank you</p>
<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p><p>Well guys You cannot connect to another computer through WAN until you port forward it and insert the correct IP..</p><p>You can use HAMACHI also but it will require the other person to use hamachi too..</p><p>Okay now see my tutorial:</p><p>You need to host the main IP on ur net or it should be a VPS in which u open a port or you port forward the port the chat will listen to.</p><p>After port forward keep the VPS/PC/OS on and make sure you dont have dynamic ip that changes each hour, now the chat server will be active and people can join the chat room with your IPv4 Online IP, type ipconfig in cmd.exe or just whatismyipaddress.com and you are done..</p><p>Add the port you forwarded in the box then click Connect.</p><p>and the IP of the host..</p><p>~Regards</p><p>K. Hendrews</p>
<p>It only works on 2 users? I tried to connect another pc but it failed</p>
<p>Where is the winsock control in Visual Studio 2013?</p>
<p>I am running my chat application on 3 computers. but they are not connecting. how should I set IP and port address of both server side and client side computers.</p>
<p>thank you!</p>
<p>thank you!</p>
<p>please help me with 40020 error..</p>
<p>please help me with 40020 error..</p>
<p>please help me with 40020 error..</p>
<p>this is working very well in the same pc and thanx a lot for that but i've tried to make it work on two but was not able to do so. can you plz tell me the way how to do it?</p>
<p>I think this program will only work in localhost so you need Hamachi to create virtual localhost and connect different computers to each other</p>
<p>maraming salamat</p>
<p>maraming salamat</p>
hi <br>i have error 40020 <br>invalid operation
can u plz let me know how to transfer files instead of text... please... it will b helpful for my project..
I haven't been on here for a while, so sorry i haven't gotten a chance to reply to a lot of you asking questions or having problems, the way i wrote this chat program i believe it only works with the older vb 6.0 the newer versions do not have the winsock control module, i am not sure how to use it either, i know its possible though
I can seem to find the &quot;Microsoft WinSock&quot; in Visual Basic 2012, please resond with a way to find it. <br> <br>thank you
every thing should be done but finally have a runtime error as &quot;object required 424&quot;
its good but runtime error &quot;object required&quot; 424
its good but error object required <br>
I tried your code and it works fine so thank you for it. <br> <br>I want to perform following task in your program :- <br>1)Group chat <br>2)Add smilies <br>3)Sending files <br> <br>Please note that i don't want to make more changes <br> <br>I use richtextbox in my program. <br> <br>I request you to upload pdf to perform above task
I am still having trouble with the sckMain.GetData(Data, vbString) line, do you have any suggestions. I fixed the rest of the errors myself, but have no clue with this one.
when i click host and then connect runtime error 40020 occurrs how i can overcome this problem
thank you now i already know it... <br>
when i click host and then connect runtime error 40020 occurrs how i can overcome this problem
when i click host and then connect runtime error 40020 occurrs how i can overcome this problem

About This Instructable




More by twenglish1:How to make a simple chat program in visual basic using the Microsoft Winsock Control How to Install and Boot Damn Small Linux on a USB Flash Drive 
Add instructable to: