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. Printer port ipaddress [modified]

Printer port ipaddress [modified]

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

    Hi, How do I programatically find the ipaddress of a printer port connected to a particular printer driver ? Added - If I have the port name how do I find out if the port is a 'Standard TCP/IP port' and once I have done that, how do I find the ipaddress ? Kevin Keeler -- modified at 9:36 Thursday 6th July, 2006

    D P 2 Replies Last reply
    0
    • K Kevin13

      Hi, How do I programatically find the ipaddress of a printer port connected to a particular printer driver ? Added - If I have the port name how do I find out if the port is a 'Standard TCP/IP port' and once I have done that, how do I find the ipaddress ? Kevin Keeler -- modified at 9:36 Thursday 6th July, 2006

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

      Use EnumPrinters(). If level is 5, look at the pPortName member of the returned structure.


      "The largest fire starts but with the smallest spark." - David Crow

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

      K 1 Reply Last reply
      0
      • D David Crow

        Use EnumPrinters(). If level is 5, look at the pPortName member of the returned structure.


        "The largest fire starts but with the smallest spark." - David Crow

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

        K Offline
        K Offline
        Kevin13
        wrote on last edited by
        #3

        Thanks, but I did not make myself clear EnumPrinters gets the port names, but then how do I get from the port name to the IP address if the port is a Standard TCP/IP port? or even how do I find if it is a Standard TCP/IP port?

        D 1 Reply Last reply
        0
        • K Kevin13

          Thanks, but I did not make myself clear EnumPrinters gets the port names, but then how do I get from the port name to the IP address if the port is a Standard TCP/IP port? or even how do I find if it is a Standard TCP/IP port?

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

          I have three networked printers configured on my machine. pPortName contained 192.168.200.11, 192.168.200.100, and 192.168.200.150 for them.

          Kevin13 wrote:

          how do I find if it is a Standard TCP/IP port?

          Use EnumPorts(NULL, 2, ...).


          "The largest fire starts but with the smallest spark." - David Crow

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

          K 1 Reply Last reply
          0
          • D David Crow

            I have three networked printers configured on my machine. pPortName contained 192.168.200.11, 192.168.200.100, and 192.168.200.150 for them.

            Kevin13 wrote:

            how do I find if it is a Standard TCP/IP port?

            Use EnumPorts(NULL, 2, ...).


            "The largest fire starts but with the smallest spark." - David Crow

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

            K Offline
            K Offline
            Kevin13
            wrote on last edited by
            #5

            I have just checked my printer and the pPortName contains IP_200.128.1.115. I then added another printer and port from control panel and specified the name of the port as 'A Test Port'. Then running the enumeration I got the original port ( IP_200.128.1.115 ) and the new one ( A Test Port ) returned as the pPortName. Thanks EnumPorts does return the pMonitorName in the PORT_INFO_2 structure so now I have got half an answer. Doing some more searching it looks as if I need to use 'TCPMON Xcv Commands' which seems to be sort of documented in the DDK.

            1 Reply Last reply
            0
            • K Kevin13

              Hi, How do I programatically find the ipaddress of a printer port connected to a particular printer driver ? Added - If I have the port name how do I find out if the port is a 'Standard TCP/IP port' and once I have done that, how do I find the ipaddress ? Kevin Keeler -- modified at 9:36 Thursday 6th July, 2006

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

              The portname returned on our network for 'standard tcp/ip' always starts with IP_, so if this is returned strip of the IP_ and the rest is your IP address. Hope this helps.

              K 1 Reply Last reply
              0
              • P pgibson007700

                The portname returned on our network for 'standard tcp/ip' always starts with IP_, so if this is returned strip of the IP_ and the rest is your IP address. Hope this helps.

                K Offline
                K Offline
                Kevin13
                wrote on last edited by
                #7

                Yes, this is the default however the user can edit the name to be any string

                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