Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need some example of C++ chat application

Need some example of C++ chat application

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialc++sysadminlounge
9 Posts 7 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello all, I need to write some application in C++ that act like some chat application.:confused: When client connect to the server - the server need to open new thread for the connection. My main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread). I looking in Google and i don't find anything.:mad: Thanks for any help. :rose::cool::)

    R E T H 4 Replies Last reply
    0
    • L Lost User

      Hello all, I need to write some application in C++ that act like some chat application.:confused: When client connect to the server - the server need to open new thread for the connection. My main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread). I looking in Google and i don't find anything.:mad: Thanks for any help. :rose::cool::)

      R Offline
      R Offline
      Reagan Conservative
      wrote on last edited by
      #2

      Why not look at some Java examples? Java is VERY similar to C++. You can probably find classes in VC++ that mimic very closely the classes you'll see in Java.

      John P.

      Z D 2 Replies Last reply
      0
      • L Lost User

        Hello all, I need to write some application in C++ that act like some chat application.:confused: When client connect to the server - the server need to open new thread for the connection. My main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread). I looking in Google and i don't find anything.:mad: Thanks for any help. :rose::cool::)

        E Offline
        E Offline
        Eric Dahlvang
        wrote on last edited by
        #3

        Tons of stuff here[^]

        --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

        1 Reply Last reply
        0
        • R Reagan Conservative

          Why not look at some Java examples? Java is VERY similar to C++. You can probably find classes in VC++ that mimic very closely the classes you'll see in Java.

          John P.

          Z Offline
          Z Offline
          Zac Howland
          wrote on last edited by
          #4

          jparken wrote:

          Why not look at some Java examples?

          I wouldn't even tell an experienced C++ programmer to do this, much less a self-proclaimed beginner. It is easy to have a C++ programmer generate a Java program using C++ as a template, but not the other way around.

          jparken wrote:

          Java is VERY similar to C++.

          Java is very different from C++ in the areas of socket programming and threads. On top of that, both of those areas are OS dependent in C++, whereas Java *tries* to have a standard way for both. To the OP ... this article should get you started.

          If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

          R 1 Reply Last reply
          0
          • R Reagan Conservative

            Why not look at some Java examples? Java is VERY similar to C++. You can probably find classes in VC++ that mimic very closely the classes you'll see in Java.

            John P.

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            jparken wrote:

            Java is VERY similar to C++.

            Only in syntax.


            "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

            "Judge not by the eye but by the heart." - Native American Proverb

            1 Reply Last reply
            0
            • Z Zac Howland

              jparken wrote:

              Why not look at some Java examples?

              I wouldn't even tell an experienced C++ programmer to do this, much less a self-proclaimed beginner. It is easy to have a C++ programmer generate a Java program using C++ as a template, but not the other way around.

              jparken wrote:

              Java is VERY similar to C++.

              Java is very different from C++ in the areas of socket programming and threads. On top of that, both of those areas are OS dependent in C++, whereas Java *tries* to have a standard way for both. To the OP ... this article should get you started.

              If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

              R Offline
              R Offline
              Reagan Conservative
              wrote on last edited by
              #6

              I'll say this --- it will be much easier for a beginner to use Java for "chat" than C++ any day! The Java IDEs (which are free) put VC++ to shame (at least for VC++ 6.0). And there are numerous books that show you "how to" exactly do something --- unlike the Microsoft stuff that never quite tell you everything you need to know about how to solve a problem. For ease of use, I'll take Java any day of the week!

              John P.

              Z 1 Reply Last reply
              0
              • R Reagan Conservative

                I'll say this --- it will be much easier for a beginner to use Java for "chat" than C++ any day! The Java IDEs (which are free) put VC++ to shame (at least for VC++ 6.0). And there are numerous books that show you "how to" exactly do something --- unlike the Microsoft stuff that never quite tell you everything you need to know about how to solve a problem. For ease of use, I'll take Java any day of the week!

                John P.

                Z Offline
                Z Offline
                Zac Howland
                wrote on last edited by
                #7

                I can argue back on that, but that wasn't the point I was making with my comment. Trying to look at Java code and derive what you would need to do in C++ is not an easy task, and definately should not be recommended to someone who states they are a beginner. As to your off-topic points: VC++ (even VC6) was FAR superior to any of the Java IDEs (even the most modern ones) when it comes to certain important features (e.g. debugging). Yes, many of the Java IDE's look prettier and will try to type for you, but more often than not, those things get in the way of development instead of doing what an IDE should do (e.g. help the developer). Granted, there are some things the Java IDEs do better, but as a user of both, I prefer VC over Eclipse or NetBeans anyday. In fact, there are times when Eclipse annoys me so much that I write my Java code using a text editor. As for books, there are just as many C++ books published (actually more) as there are Java books. Granted, not all of them are terribly useful for beginners, but that can be said for the Java books as well. Say what you want about Microsoft ... but MSDN (even with its minor hickups) is still FAR more useful than Sun's javadocs which are great at telling you how to call a function, but almost never tell you how to use it.

                If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

                1 Reply Last reply
                0
                • L Lost User

                  Hello all, I need to write some application in C++ that act like some chat application.:confused: When client connect to the server - the server need to open new thread for the connection. My main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread). I looking in Google and i don't find anything.:mad: Thanks for any help. :rose::cool::)

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #8

                  Yanshof wrote:

                  y main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread).

                  http://www.codeproject.com/internet/winsockintro03.asp[^]

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

                  1 Reply Last reply
                  0
                  • L Lost User

                    Hello all, I need to write some application in C++ that act like some chat application.:confused: When client connect to the server - the server need to open new thread for the connection. My main problem is the communication issue ... i don't know a lot about communication programming in C++ and i need to learn how to do it (specially the issue of open thread). I looking in Google and i don't find anything.:mad: Thanks for any help. :rose::cool::)

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    See Simple Chat Program [^]

                    _**


                    **_

                    WhiteSky


                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups