Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Capturing a LPT port in NT
Message
De
23/10/1998 16:52:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Capturing a LPT port in NT
Divers
Thread ID:
00150018
Message ID:
00150018
Vues:
48
I am attempting to use the following code to attach a local LPT port to a Windows printer. I must map it to an LPT port for an application that uses LPT ports to print to.

clear
declare integer WNetAddConnection in "mpr.dll" string @, string @, string @

cServerName = "\\NORDAM_NDS\Q_MIS_PROG_4K"
cLocalname = "LPT2:"
cPassword = "0"

nResult = WNetAddConnection(@cServername,@cPassWord,@cLocalName)
? nResult

IF APRINTERS(gaPrinters) > 0 && If there are installed printers
DISPLAY MEMORY LIKE gaPrinters && Display printers and ports
ELSE && Otherwise, no printers are installed
WAIT WINDOW 'No printers installed.'
ENDIF


I am getting an Error code 5... access denied. But, if I go into Control Panel, Printers... I can map this printer to an LPT port using the Properties of the printer. ??? Help! ???

-Tim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform