giving activex dll correct account permisions

J

James

how come i can't print to a network printer from inside my activex dll? i
load this dll in an asp page. the dll just loads a page into a webbrowser
control and then trys to print it. i can call my dll from a normal vb app
and it works fine. my guess is that when IIS loads the dll it is running as
SYSTEM. thats why i tried to use the Impersonate user code as well. i guess
system can't access my network resources like my printers. any one have any
ideas?

'here is my dll code:

Public Function SendPrintJob() As String
On Error GoTo ErrorSub

' navigate to a Web site for testing purposes.
frmPrintOrder.WebBrowser1.Navigate ("http://www.google.com")


Do While (frmPrintOrder.WebBrowser1.QueryStatusWB(OLECMDID_PRINT) And
OLECMDF_ENABLED) = 0
DoEvents
Loop

' print the contents of the Web Browser control.
Call frmPrintOrder.WebBrowser1.ExecWB(OLECMDID_PRINT,
OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)

SendPrintJob = "NoErrors"
Exit Function

ErrorSub:
SendPrintJob = "Error #: " & Err.Number & " Desc: " & Err.Description

End Function
<%
'here is my asp code:
Option Explicit
Dim objLogon
dim objPrintOrder
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "user", "password", "domain"
set objPrintOrder = server.CreateObject("jdpPrintOrder.clsPrintOrder")
Response.write objPrintOrder.SendPrintJob
set objPrintOrder = nothing
objLogon.Logoff
Set objLogon = Nothing
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,588
Members
45,100
Latest member
MelodeeFaj
Top