Information générale
Catégorie:
Fonctions Windows API
Titre:
Capturing a LPT port in NT
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
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