JOB_INFO_2 Time member not set
-
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!
-
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!
Has the job been printed yet? If not, zero would be the right value.
-
Has the job been printed yet? If not, zero would be the right value.
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.
-
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.
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.
-
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.
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.
-
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!
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
-
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
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!