Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capturing a LPT port in NT
Message
From
23/10/1998 16:52:59
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Capturing a LPT port in NT
Miscellaneous
Thread ID:
00150018
Message ID:
00150018
Views:
47
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
Map
View

Click here to load this message in the networking platform