Reputation: 12821
I have an activeX dll that was written in vb6. Inside that code it uses the LoadResPicture()
to load an image that it then sends to a printer (using PaintPicture
)
If I call this DLL using an ASPX page, that hosted on a Windows 2008 box running IIS 7.0, the image doesn't print.
If I call this DLL using a VBS script on the very same server, the image prints fine.
The image used to print fine when the aspx page was hosted on a Windows 2000 Server.
Here is the VBS Code:
Dim CheckCtl
set CheckCtl = CreateObject("CHECKCONTROL.CHECK")
CheckCtl.FBOAccountID = 2765
CheckCtl.includesignature = True
CheckCtl.Amount = 500.00
CheckCtl.CheckDate = #04/06/2011#
CheckCtl.Payee_L1 = "Donald Trump"
CheckCtl.Payee_L2 = "10 Park Place"
CheckCtl.Payee_L3 = "Atlantic City, NJ 00011"
CheckCtl.Payee_L4 = ""
CheckCtl.Notes = "This is a test check"
CheckCtl.SubmittedBy = "Accountant"
dim lSuccess
lSuccess = CheckCtl.Printcheck()
Here is the ASPX VB.NET Code:
Dim CheckCtl As checkcontrolNET.Check
CheckCtl = New checkcontrolNET.Check
CheckCtl.FBOAccountId = 2765
CheckCtl.IncludeSignature = True
CheckCtl.Amount = 500.0
CheckCtl.CheckDate = "04/06/2011"
CheckCtl.Payee_L1 = "Donald Trump"
CheckCtl.Payee_L2 = "10 Park Place"
CheckCtl.Payee_L3 = "Atlantic City, NJ 00011"
CheckCtl.Payee_L4 = ""
CheckCtl.notes = "This is a test check"
CheckCtl.SubmittedBy = "Accountant"
Dim lSuccess As Boolean
lSuccess = CheckCtl.printcheck()
Response.Write(lSuccess)
What am I missing?
Upvotes: 1
Views: 762
Reputation: 10623
I found COM+ approach for VB ActiveX with IIS wacky. I hope you have control over VB6 Dlls code and if so, try putting this code into the VB6 class you are trying to instantiate.
Private moScriptCtx As ScriptingContext
Public Sub OnStartPage(SC As ScriptingContext)
Set moScriptCtx = SC
End Sub
You can now access Request,Response,Server etc as properties of the moScriptCtx object. ASP automagically calls OnStartPage()
for you during the CreateObject execution.
[EDIT]
This may not be useful in your case if you are not useing ASP's intrinsic properties, but try enabling this on COM+ management console.
Fire up the COM+ management consoleo
Find the COM+ Application in questiono
Find the applicable component in the 'Components' folder
Right click on it and choose properties
Select the Advanced tab
Check the 'Allow IIS Intrinsic Properties' checkbox
Upvotes: 1
Reputation: 55427
Is your server 64-bit by any chance? According to MSDN, the .Net version of that function is only supported on 32-bit versions so its possible the same may be true for the VB6 version.
http://msdn.microsoft.com/en-us/library/ms652936.aspx
Upvotes: 1
Reputation: 119816
This sounds suspiciously like a permissions problem. I suspect that your Windows 2000 server ran IIS under the SYSTEM
account and probably did the same with the old ASPNET
worker process account.
Check that the account that the site runs under has permissions to print. Depending on how you've secured the site this could be any one of:
IUSR
accountUpvotes: 0