Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking LPT1 printer online
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00308803
Message ID:
00309521
Vues:
65
>George,
>
>>One of the reasons (there are many) I'm switching is to familiarize myself >with NT functionality and its API. I just can't stay 'way from this low level stuff.:-)
>
>Its funny you mention that, I was just talking to someone about how alluring this whole low level stuff is, and to date, I have yet to use any of it in work-related code. :)
>
>I am looking at some NT specific API functions:
>FindNextPrinterChangeNotification
>FindFirstPrinterChangeNotification
>FindClosePrinterChangeNotification
>
>These are all in winspool.drv as are OpenPrinter, and ClosePrinter (to get and release a handle to a printer respectively)
>
>Now I was going to say that I was going to play with these, and get back to you, but I can't get the printer handle with OpenPrinter:
>
>DECLARE INTEGER OpenPrinter IN "winspool.drv" AS OpenPrinterA STRING, @INTEGER, INTEGER
>DECLARE INTEGER ClosePrinter IN "winspool.drv" LONG
>
>PRIVATE ln_handle
>ln_success = 0
>ln_handle = 0
>
>ln_successs = OpenPrinterA(GETPRINTER(),@ln_handle,0) &&Error here
>...

>comes back with an error "Too Many Arguments"
>
>I am somewhat stumped. Any ideas?

Get the printer name as a string outside of the the function call. Then explicity pass it as a string by reference. That's the source.

>As for the find functions, they get information like unable to connect to printer, and print job completed back from a printer or print driver. There are several flags that can be set (check them out in MSDN). There are also some structures involved so I thought this would give me an excuse to download Christof's Struct Class, but I am going to have to wait on that.

I haven't played with these at all. So I can't offer any expertise with them.

>Anyway, I suffer from the same fascination with Low Level stuff you do George, so any insight here will be appreciated. I am not sure how if at all, this will help Andrus, but now I'm curious what info these functions will return.
>

Well, I often refer to myself as a "bit-twiddler" because of it.:-) Well, to the club< g >.

Regards,
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