Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL winSpool OpenPrinter - Access Is denied

Status
Not open for further replies.

LCD

MIS
Feb 19, 2001
72
0
0
US
Don't know exactly what Forum to post this in, hope this is on topic.

I made a ActiveX.dll to Send raw data to a spooler. (Using source code available in this pdf: Then created a ASP page that calls the DLL. Tested this from the local server, and the prints come out error free. But when I access the page from a remote computer, it fails.

-----[Begin Code]----------
lResult = OpenPrinter(PrnName, hPrn, pdefs)
If (hPrn = 0) Then
lErrCode = Err.LastDllError
Call TraceMessage("GetLastError =" & CStr(lErrCode))
Exit Sub
End If
-----[END CODE]------------

GetLastError Gives a Error code of 5 when it tries to open the printer.

Can anyone offer suggestions as to what can be hanging this up.

Server = Win2k sp3 w/
(Let me know if more info is needed)

Thank You
Andrew
 
Are your trying to print out the page using ASP to your own printer?
ASP is server side code so it would be trying to print the page to a printer attached to the server.



 
The printer is a network shared printer.
 
I found the solution to my problem. I Had "Intergrated Windows Authentication" enabled in IIS. That unfortunatly wasn't passing the proper user info along to the DLL & Spooler. Once I disabled It and enabled "Basic Authentication" it began to work.

Thanks,
Andrew (LCD)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top