Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I get the number of jobs in print queue
Message
 
 
À
08/01/2003 12:22:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00737034
Message ID:
00740165
Vues:
28
Kouakou,

I don't have a printer attached to this notebook, so I can't really to any testing of the code. Frankly I'd use C++ to do this and write a wrapper DLL to make the info easier to get to from VFP. have you looked at Bela Bodec's FLL from the library here? I don't recall if it supplies this info of not.

Once you call GetJob() with a buffer sized big enough and JOB_INFO_1 a DWORD is 4 bytes, a LPTSTR is 4 bytes, SYSTEMTIME is 16 bytes.

typedef struct _JOB_INFO_1 {
DWORD JobId;
LPTSTR pPrinterName;
LPTSTR pMachineName;
LPTSTR pUserName;
LPTSTR pDocument;
LPTSTR pDatatype;
LPTSTR pStatus;
DWORD Status;
DWORD Priority;
DWORD Position;
DWORD TotalPages;
DWORD PagesPrinted;
SYSTEMTIME Submitted;
} JOB_INFO_1, *PJOB_INFO_1;

The bytes in the string that comes back need to be converted to integer values to change from DWORD to a number. the LPTSTR bytes are pointers, and you'll have to use another API call to bring that string down into the VFP memory space. Christof posted some code you can use in the message http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,15,722022

You might also want to get Christof's struct class from the library here.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform