Visual Basic
  Home arrow Visual Basic arrow Page 7 - Two Person Chat With The Winsock Control A...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC

Two Person Chat With The Winsock Control And Visual Basic
By: Jason Brimblecombe
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 278
    2002-01-12

    Table of Contents:
  • Two Person Chat With The Winsock Control And Visual Basic
  • Creating the chat form
  • Code from the clients point of view
  • Code from the clients point of view (contd.)
  • Code from the servers point of view
  • Using our chat application
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Two Person Chat With The Winsock Control And Visual Basic - Conclusion


    (Page 7 of 7 )

    One of the reasons Visual Basic is so popular is because of the way it gives us access to libraries and controls so easily. In this example, you've seen how easy it is to setup a complete chat application using the Winsock ActiveX control.

    If you're interested in Winsock, then you can take our chat application and give it added functionality. Here are some ideas that you may want to try and implement:
    • Playing Sounds: Let users click a button to play a sound in the other users chat application. The easiest way to do this is to send a message such as "<< PLAY SOUND LAUGH.WAV>>" to the other computer. When that computer receives this message, it should extract the name of the file from the message (laugh.wav) and use the windows media control to play that sound.
    • Sending Files: A more difficult idea would be to allow users to swap files with each other. To do this, you'll want to break up the file and send it in chunks. You'll need to prepend the send with some sort of header block such as "<< INCOMING FILE myfile.txt >>", so that the receiving computer knows a file is on its way. Once the entire file has been sent, use a closing block to tell the receiving computer that the file send is complete.
    • Save Messages: Just like ICQ, you might want to experiment with saving messages into a users history area. You could use a flat file or a simple access database and ADO to do this. For a database, simply create three fields: messageId, message, and author. Whenever the send button is clicked, you would use an "INSERT INTO ..." command to add a new record to the database. Add a button to the chat application called history. Whenever the user clicks on it, use a "SELECT * FROM Messages WHERE author = ..." SQL query to retrieve each message in that users history.
    Please take a look at some of the links and books below for more information on Winsock and network/internet programming.

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · You say you can download it @ the last page ...No download or what so ever
       · dude the point of coding isn't to just download people's full program then change...
       · LIAR...On the first page of the tut, you SAID that the download is at the last page....
       · You are right loozahhh..patience is the point..
       · I apologize for sounding like an anonymous loozah, but I am having some issues with...
       · the code:additemdosent work. is there any declarations for it or sumthin plz...
       · nvm i figured it out but i cant get the other ppl to see that i disconnected, have a...
       · How Did you fix? @person above me
       · like A chat with B in one window , and chat with C in other indow??
       · you say that "To use our chat application, simply download the support material from...
     

    VISUAL BASIC ARTICLES

    - Developing an XML Web Service Using Visual S...
    - Creating an HTML File List with VB
    - Fun with Email: VB6, CDO, MAPI, and a Remote...
    - Extranet/Intranet Dictionary Cracker in VB
    - Finding Default App Icons With Visual Basic
    - Registry Fever With Visual Basic
    - Implementing An ADO Data Control With VB6
    - Printing With Visual Basic
    - MSMQ Part 1/2: Architecture and Simple Imple...
    - Magnifying The Desktop With Visual Basic
    - Sending Email With MAPI Components in Visual...
    - Two Person Chat With The Winsock Control And...
    - A Real-Time ActiveX News Control
    - Accessing the Windows API in Visual Basic







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek