General information
Category:
Windows API functions
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only