Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Using APRINTERS to select printers
We've created a printer selection dialog to let the user select different printers for different output types (reports versus labels, etc.) When then use SET PRINTER TO NAME {printer} to select the correct printer. A problems occurs when you consider different OSs.
We've notices that Win9x expects {printer} to be the windows printer name (as it appears in the Printers folder) while NT expects {printer} to be the full UNC path to the printer \\servername\queue. Since APRINTERS will give you both versions of the printer name, we can simply detect the OS (we're using the W32API function GetVersion) and then using the UNC path or name as needed.
Is there a better way to do this? Also, is there a SYS call that will tell you the OS? We don't want to use the sysinfo OCX since there's a potential problem with registration on users machines (as with all OCX's).
Thanks,
Chris Vesper
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement