Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
APRINTERS() doesn't seem to work right
Message
 
À
20/04/2007 11:33:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01218322
Message ID:
01218343
Vues:
40
>I use aprinters() to get all the printers on a user's machine. Weird thing is that when I want to pick a given printer sometimes it does'nt appear in the list of available printers.
>
>And if I come back to it either after closing the application or even trying again later (without closing the app) it works allright.
>
>One system is alone and another one is part of a network.
>
>Any explanation for this behaviour?
>
>Would you recommend something other than aprinter() to get the printers?

One way
CLEAR
strComputer = "."
objWMIService = Getobject("winmgmts:"+ "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colInstalledPrinters = objWMIService.ExecQuery("SELECT * FROM Win32_Printer")
For Each objPrinter In colInstalledPrinters
    ?"Name: " + objPrinter.Name
Next
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform