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. any borland helpers

any borland helpers

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++delphisysadmintesting
6 Posts 3 Posters 0 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.
  • P Offline
    P Offline
    porac69
    wrote on last edited by
    #1

    greetings I am really sorry to bother you but i have a slight problem. i am a university student in England, and i am doing a final year project called Web based home automation which means i have to control devices over the internet. the problem is that i have to use borland C++ to write a client/server program to be able to remotely control devices over the internet. The problem is that i have tried to work with borland C++ version 5.01 but i am unable to do this because, although i know the basics of programming in c,c++,assembly i am someone who is aimed at automation and not really programming. i basically need to write a simple client/server chat program in c/c++ with borland, and then elaborate on it to enable controlling devices. please help me, i am really stressed out. i extremely appreciate any help you can give me! from Chris

    A 1 Reply Last reply
    0
    • P porac69

      greetings I am really sorry to bother you but i have a slight problem. i am a university student in England, and i am doing a final year project called Web based home automation which means i have to control devices over the internet. the problem is that i have to use borland C++ to write a client/server program to be able to remotely control devices over the internet. The problem is that i have tried to work with borland C++ version 5.01 but i am unable to do this because, although i know the basics of programming in c,c++,assembly i am someone who is aimed at automation and not really programming. i basically need to write a simple client/server chat program in c/c++ with borland, and then elaborate on it to enable controlling devices. please help me, i am really stressed out. i extremely appreciate any help you can give me! from Chris

      A Offline
      A Offline
      Antony M Kancidrowski
      wrote on last edited by
      #2

      You got all the way to your final year and have just realised you are not a programmer? :rolleyes: I suggest that you quit and find a different degree to do. Though I would be surprised that you find one where plagiarism is accepted. :| Ant. I'm hard, yet soft.
      I'm coloured, yet clear.
      I'm fruity and sweet.
      I'm jelly, what am I? Muse on it further, I shall return!
      - David Williams (Little Britain)

      P 1 Reply Last reply
      0
      • A Antony M Kancidrowski

        You got all the way to your final year and have just realised you are not a programmer? :rolleyes: I suggest that you quit and find a different degree to do. Though I would be surprised that you find one where plagiarism is accepted. :| Ant. I'm hard, yet soft.
        I'm coloured, yet clear.
        I'm fruity and sweet.
        I'm jelly, what am I? Muse on it further, I shall return!
        - David Williams (Little Britain)

        P Offline
        P Offline
        porac69
        wrote on last edited by
        #3

        hahaha you're so funny! 1st: who told you thet i was in a programming course? 2nd: its nice to laugh at others problems untill you get one hey? 3rd:plagerism means cheating/copying...i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS! thanks

        D 1 Reply Last reply
        0
        • P porac69

          hahaha you're so funny! 1st: who told you thet i was in a programming course? 2nd: its nice to laugh at others problems untill you get one hey? 3rd:plagerism means cheating/copying...i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS! thanks

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

          porac69 wrote: 1st: who told you thet i was in a programming course? You were asking a programming question in a programming forum. It would be easy to assume you are therefore in a programming course. porac69 wrote: i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS! "Please do my homework for me" type requests show up here at least once per week, especially as semesters come to an end. Don't take offense to Antony's comment as it is well-founded. While yours is not the worst by far, students do come here and type in their assignments verbatim and expect to get help. My first question would by why is using Borland C++ a requirement? Second, how much help are you expecting to receive from a forum devoted to Microsoft Visual C++? That's not to imply that you won't get help, but just that your chances are less, compared to the help you'd receive from a forum devoted to Borland C++. Make sense? I put together a very simple server application that listens on port 13. When it gets a request, it sends some text back to the client. I've removed the error checking for brevity.

          void main( void )
          {
          WSADATA wsaData;
          int rVal;
          char Str[32];
          SOCKET client;

          WSAStartup(MAKEWORD(1,1), &wsaData);
          
          //create socket
          SOCKET s = socket(PF\_INET, SOCK\_STREAM, IPPROTO\_TCP);
          
          //fill in sockaddr\_in struct 
          SOCKADDR\_IN sin, clientaddr;
          sin.sin\_family = PF\_INET;
          sin.sin\_port = htons(13);
          sin.sin\_addr.s\_addr = INADDR\_ANY;
          
          //bind the socket
          rVal = bind(s, (LPSOCKADDR) &sin, sizeof(sin));
          
          //get socket to listen 
          rVal = listen(s, 2);
          
          while (1)
          {
              int addrlen = sizeof(clientaddr);
          
              //wait for a client
              client = accept(s, (struct sockaddr \*) &clientaddr, &addrlen);
          
              if (client < 0)
                  continue;
          
              char \*clienthost = inet\_ntoa(clientaddr.sin\_addr);
              int port = ntohs(clientaddr.sin\_port);
          
              fprintf(stderr, "Received request from \[%s\] on port \[%d\]\\n", clienthost, port);
          
              sprintf(Str, "Hello %s on %d", clienthost, port);
          
              rVal = send(client, Str, lstrlen(Str), 0);
          
              closesocket(client);
          
              fprintf(stderr, "Sent %s to client\\n", Str);
          }
          
          closesocket(s);
          
          WSACleanup();
          

          }


          "When I was born I was s

          P 1 Reply Last reply
          0
          • D David Crow

            porac69 wrote: 1st: who told you thet i was in a programming course? You were asking a programming question in a programming forum. It would be easy to assume you are therefore in a programming course. porac69 wrote: i am not asking for someone to write code for me, i just want some advice so if you are too good to help, MIND YOUR OWN BUSINESS! "Please do my homework for me" type requests show up here at least once per week, especially as semesters come to an end. Don't take offense to Antony's comment as it is well-founded. While yours is not the worst by far, students do come here and type in their assignments verbatim and expect to get help. My first question would by why is using Borland C++ a requirement? Second, how much help are you expecting to receive from a forum devoted to Microsoft Visual C++? That's not to imply that you won't get help, but just that your chances are less, compared to the help you'd receive from a forum devoted to Borland C++. Make sense? I put together a very simple server application that listens on port 13. When it gets a request, it sends some text back to the client. I've removed the error checking for brevity.

            void main( void )
            {
            WSADATA wsaData;
            int rVal;
            char Str[32];
            SOCKET client;

            WSAStartup(MAKEWORD(1,1), &wsaData);
            
            //create socket
            SOCKET s = socket(PF\_INET, SOCK\_STREAM, IPPROTO\_TCP);
            
            //fill in sockaddr\_in struct 
            SOCKADDR\_IN sin, clientaddr;
            sin.sin\_family = PF\_INET;
            sin.sin\_port = htons(13);
            sin.sin\_addr.s\_addr = INADDR\_ANY;
            
            //bind the socket
            rVal = bind(s, (LPSOCKADDR) &sin, sizeof(sin));
            
            //get socket to listen 
            rVal = listen(s, 2);
            
            while (1)
            {
                int addrlen = sizeof(clientaddr);
            
                //wait for a client
                client = accept(s, (struct sockaddr \*) &clientaddr, &addrlen);
            
                if (client < 0)
                    continue;
            
                char \*clienthost = inet\_ntoa(clientaddr.sin\_addr);
                int port = ntohs(clientaddr.sin\_port);
            
                fprintf(stderr, "Received request from \[%s\] on port \[%d\]\\n", clienthost, port);
            
                sprintf(Str, "Hello %s on %d", clienthost, port);
            
                rVal = send(client, Str, lstrlen(Str), 0);
            
                closesocket(client);
            
                fprintf(stderr, "Sent %s to client\\n", Str);
            }
            
            closesocket(s);
            
            WSACleanup();
            

            }


            "When I was born I was s

            P Offline
            P Offline
            porac69
            wrote on last edited by
            #5

            thanks alot its just that ive been in front of the pc screen for 3 nights without more than 2 hours sleep. i must use borland because that is a specification i started off with. i am not useless...i do know how to program but i am not familiar with internet programming and all those .cpp .dll . ... files make me confused, especially when youre in front of a pc for so long trying your best. i believe no-one knows everything so why not learn from eachother?!? thank you once again ;)

            P 1 Reply Last reply
            0
            • P porac69

              thanks alot its just that ive been in front of the pc screen for 3 nights without more than 2 hours sleep. i must use borland because that is a specification i started off with. i am not useless...i do know how to program but i am not familiar with internet programming and all those .cpp .dll . ... files make me confused, especially when youre in front of a pc for so long trying your best. i believe no-one knows everything so why not learn from eachother?!? thank you once again ;)

              P Offline
              P Offline
              porac69
              wrote on last edited by
              #6

              well, thanx alot for your concern guys! its just that my main problem is not the code, its trying to arrange a graphical interface for my "chat program" with borland. i dont know how to do that and i dont know if borland 5.01 enables me to. ;)

              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