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. Convert IP4_ADDRESS to string ?

Convert IP4_ADDRESS to string ?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • S Offline
    S Offline
    ScorpioMidget
    wrote on last edited by
    #1

    Been playing around with DnsQuery() but i can't find a way to convert from IP4_ADDRESS to a string. Hoping you can help me. ScorpioMidget

    R D 2 Replies Last reply
    0
    • S ScorpioMidget

      Been playing around with DnsQuery() but i can't find a way to convert from IP4_ADDRESS to a string. Hoping you can help me. ScorpioMidget

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Microsoft provides functions to retrieve the four bytes of the IP adress. So call them one after another, and use a CString or strcat to concatenate the result. ~RaGE();

      S 1 Reply Last reply
      0
      • S ScorpioMidget

        Been playing around with DnsQuery() but i can't find a way to convert from IP4_ADDRESS to a string. Hoping you can help me. ScorpioMidget

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

        Does gethostbyaddr() or inet_ntoa() work for you?

        S 1 Reply Last reply
        0
        • R Rage

          Microsoft provides functions to retrieve the four bytes of the IP adress. So call them one after another, and use a CString or strcat to concatenate the result. ~RaGE();

          S Offline
          S Offline
          ScorpioMidget
          wrote on last edited by
          #4

          Many thanks, i've got it working now. ScorpioMidget

          1 Reply Last reply
          0
          • D David Crow

            Does gethostbyaddr() or inet_ntoa() work for you?

            S Offline
            S Offline
            ScorpioMidget
            wrote on last edited by
            #5

            Not tried them yet, will have a go in a few minutes. ScorpioMidget

            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