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. JOB_INFO_2 Time member not set

JOB_INFO_2 Time member not set

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelpc++questionannouncement
7 Posts 4 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
    koothkeeper
    wrote on last edited by
    #1

    HELP! I've searched all over this, Microsoft's, and many other sites. In using EnumJobs in C++ version 6, I am specifying a JOB_INFO_2 structure. According to the MSDN: Time Specifies the total time, in milliseconds, that has elapsed since the job began printing. However, this value is always zero. The EnumJobs function always returns TRUE, and the rest of the structure's members seem OK. Does anyone out there know if there is a bug in the API that discusses anything about this? I greatly appreciate it in advance!

    G D 2 Replies Last reply
    0
    • K koothkeeper

      HELP! I've searched all over this, Microsoft's, and many other sites. In using EnumJobs in C++ version 6, I am specifying a JOB_INFO_2 structure. According to the MSDN: Time Specifies the total time, in milliseconds, that has elapsed since the job began printing. However, this value is always zero. The EnumJobs function always returns TRUE, and the rest of the structure's members seem OK. Does anyone out there know if there is a bug in the API that discusses anything about this? I greatly appreciate it in advance!

      G Offline
      G Offline
      Graham Bradshaw
      wrote on last edited by
      #2

      Has the job been printed yet? If not, zero would be the right value.

      K 1 Reply Last reply
      0
      • G Graham Bradshaw

        Has the job been printed yet? If not, zero would be the right value.

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

        Hey thanks for your input! Hmmmm. Good question. I have the job paused, so no, it hasn't been printed. I assumed, perhaps incorrectly, that the time would be updated on each call to EnumJobs. Did I miss something in the documentation? What I'm trying to do is capture all jobs for printers that I am monitoring. I pause the job, then notify another program (via the clipboard) that a job is being printed. I need to know when the other app is is finished adding its content to the job (or some period of time) so I can unpause it. While I know there are several solutions to what I need to do, I thought that time member of the JOB_INFO_2 struct would do the trick. But alas it doesn't get updated.

        G B 2 Replies Last reply
        0
        • K koothkeeper

          Hey thanks for your input! Hmmmm. Good question. I have the job paused, so no, it hasn't been printed. I assumed, perhaps incorrectly, that the time would be updated on each call to EnumJobs. Did I miss something in the documentation? What I'm trying to do is capture all jobs for printers that I am monitoring. I pause the job, then notify another program (via the clipboard) that a job is being printed. I need to know when the other app is is finished adding its content to the job (or some period of time) so I can unpause it. While I know there are several solutions to what I need to do, I thought that time member of the JOB_INFO_2 struct would do the trick. But alas it doesn't get updated.

          G Offline
          G Offline
          Graham Bradshaw
          wrote on last edited by
          #4

          MSDN says: Specifies the total time, in milliseconds, that has elapsed since the job began printing. As I read that, the value will be zero until it actually starts printing.

          1 Reply Last reply
          0
          • K koothkeeper

            Hey thanks for your input! Hmmmm. Good question. I have the job paused, so no, it hasn't been printed. I assumed, perhaps incorrectly, that the time would be updated on each call to EnumJobs. Did I miss something in the documentation? What I'm trying to do is capture all jobs for printers that I am monitoring. I pause the job, then notify another program (via the clipboard) that a job is being printed. I need to know when the other app is is finished adding its content to the job (or some period of time) so I can unpause it. While I know there are several solutions to what I need to do, I thought that time member of the JOB_INFO_2 struct would do the trick. But alas it doesn't get updated.

            B Offline
            B Offline
            Blake Miller
            wrote on last edited by
            #5

            Also try calling GetJob on the specific job you are interested in. That might 'coerce' the printer driver or printer monitor into filling in more current data.

            1 Reply Last reply
            0
            • K koothkeeper

              HELP! I've searched all over this, Microsoft's, and many other sites. In using EnumJobs in C++ version 6, I am specifying a JOB_INFO_2 structure. According to the MSDN: Time Specifies the total time, in milliseconds, that has elapsed since the job began printing. However, this value is always zero. The EnumJobs function always returns TRUE, and the rest of the structure's members seem OK. Does anyone out there know if there is a bug in the API that discusses anything about this? I greatly appreciate it in advance!

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

              Keith E. Cooper wrote: However, this value is always zero. Don't dismiss the possibility that the printer driver mfg. may not be updating/returning that information.


              "One must learn from the bite of the fire to leave it alone." - Native American Proverb

              K 1 Reply Last reply
              0
              • D David Crow

                Keith E. Cooper wrote: However, this value is always zero. Don't dismiss the possibility that the printer driver mfg. may not be updating/returning that information.


                "One must learn from the bite of the fire to leave it alone." - Native American Proverb

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

                Well, it turns out I had two problems. One, I wasn't selecting the JOB_NOTIFY_FIELD_TIME in my FindFirstPrinterChangeNotification and FindNextPrinterChangeNotification calls, and two, y'all were right, that field doesn't get modified until the printer started actually printing. I was able to use the JOB_NOTIFY_FIELD_TOTAL_BYTES field to get the event when the other application was writing to the spool file (it's a long story). Thanks to you all who responded!

                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