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. getting a machine's ip address

getting a machine's ip address

Scheduled Pinned Locked Moved C / C++ / MFC
c++
7 Posts 6 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.
  • K Offline
    K Offline
    Kuniva
    wrote on last edited by
    #1

    Hi, i need the function to get a machine's ip address. I remember there was a simple function for this without MFC allthough it doesn't really matter if its with MFC or not. I just forgot it and cant find it anymore. So i'd be thankful if someone could tell me. Many thanks. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

    J V 2 Replies Last reply
    0
    • K Kuniva

      Hi, i need the function to get a machine's ip address. I remember there was a simple function for this without MFC allthough it doesn't really matter if its with MFC or not. I just forgot it and cant find it anymore. So i'd be thankful if someone could tell me. Many thanks. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

      J Offline
      J Offline
      Jon Sagara
      wrote on last edited by
      #2

      Someone post this link in another post. Jon Sagara What about :bob:?

      1 Reply Last reply
      0
      • K Kuniva

        Hi, i need the function to get a machine's ip address. I remember there was a simple function for this without MFC allthough it doesn't really matter if its with MFC or not. I just forgot it and cant find it anymore. So i'd be thankful if someone could tell me. Many thanks. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

        V Offline
        V Offline
        Vladimir Georgiev
        wrote on last edited by
        #3

        gethostbyname() "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

        K 1 Reply Last reply
        0
        • V Vladimir Georgiev

          gethostbyname() "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

          K Offline
          K Offline
          Kuniva
          wrote on last edited by
          #4

          erh... this is gonna sound silly but how do i convert a const char* to a CString??? I guess working with CStrings all the time has kind of killed my knowledge of chars and pointers... Thanks again for your answer. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

          M B 2 Replies Last reply
          0
          • K Kuniva

            erh... this is gonna sound silly but how do i convert a const char* to a CString??? I guess working with CStrings all the time has kind of killed my knowledge of chars and pointers... Thanks again for your answer. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

            M Offline
            M Offline
            Mark Donkers
            wrote on last edited by
            #5

            CString strText; strText.Format(_T("%s"), szString); Marcus Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope -- Daniel Burnham

            L 1 Reply Last reply
            0
            • M Mark Donkers

              CString strText; strText.Format(_T("%s"), szString); Marcus Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope -- Daniel Burnham

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              or more simply.... CString strText(szString); John

              1 Reply Last reply
              0
              • K Kuniva

                erh... this is gonna sound silly but how do i convert a const char* to a CString??? I guess working with CStrings all the time has kind of killed my knowledge of chars and pointers... Thanks again for your answer. Kuniva -------------------------------------------- God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.

                B Offline
                B Offline
                borland
                wrote on last edited by
                #7

                you can just go CString str = (some char*) and it'll work : Wherever you go, there you are, and you wish you were somewhere else :

                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