Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can any see what's wrong with the following?
Message
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00266137
Message ID:
00269835
Vues:
28
>>First, thanks for your help. What I wrote was a modification of MS KB Article Q140285 (How to modify printer settings using SetPrinter).
>
>I found many MS KB code samples that simply don't work, or contain errors, memory leaks, etc. Many times they are just old.

And as I've found out, sometimes the errors are caused by the fact that (apparently) a *.cpp file is compiled differently than a *.c.

>>Anyway, after changing the printer handle from LPHANDLE to HANDLE, and the parameter passing required. It still didn't work. Then, on a guess, I removed changed the following:
>>/* Removed the following */
>>dSize = sizeof(prninfo)
>>/* Changed */
>>GetPrinter(iHandle, level, (LPBYTE)prninfo, dSize, &numbytes);
>>/* to the following */
>>GetPrinter(iHandle, level, (LPBYTE)prninfo, numbytes, &numbytes);
>>Then I could get the attributes correctly. However, the status must only be available after a print job has been set.
>
>That's the whole point for getting the buffer size and using a buffer instead of a structure (of the corresponding type) directly.
>
Well, you know I'm a definite newbie at this.< g > Thanks for your input (and patience).
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform