Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Printers
Message
De
15/03/2005 19:02:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Adding Printers
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00996148
Message ID:
00996148
Vues:
58
hello everybody.

in my quest to programaticly (without user intervention) add a network printer to a local machine (threads #995713 and #995563) i've come across the following link on the ms website: http://support.microsoft.com/kb/147202/EN-US/.

on this (the Windows95 version) i have 2 questions:
1st how do you convert the code to vfp code?
2nd they talk about copying the driver files to the local machine. the copying process is easy enough, but how do i find out what the driver files on the remote machine are?
   PRINTER_INFO_2 pi2;
   DRIVER_INFO_2 di2;
   HANDLE hPrinter;

   ZeroMemory(&di2, sizeof(DRIVER_INFO_2));
   di2.cVersion = 1024;
   di2.pName = "HP Laserjet 4Si";
   di2.pEnvironment = "Windows 4.0";
   di2.pDriverPath = "c:\\windows\\system\\hppcl5ms.drv";
   di2.pDataFile   = "c:\\windows\\system\\hppcl5ms.drv";
   di2.pConfigFile = "c:\\windows\\system\\hppcl5ms.drv";
   AddPrinterDriver(NULL, 2, (LPBYTE)&di2);

   ZeroMemory(&pi2, sizeof(PRINTER_INFO_2));
   pi2.pPrinterName = "HP Laserjet 4Si";
   pi2.pPortName = "\\\\server\\print_share";
   pi2.pDriverName = "HP Laserjet 4Si";
   pi2.pPrintProcessor = "WinPrint";
   pi2.pDatatype = "EMF";
   hPrinter = AddPrinter(NULL, 2, (LPBYTE)&pi2);
   ClosePrinter(hPrinter);
thanks for all your help!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform