Hi,
I'm having trouble getting an activeXDLL component that I created to work in asp.
It works fine in a VB6 windows app, but for some reason, it won't work in my asp page.
I compiled the dll, and registered it on the server.
Here is the DLL Code -
Option Explicit
-
-
'------------------------------------------------
-
'API Calls Start
-
'------------------------------------------------
-
'Win32 API
-
'GhostScript API
-
-
Private Declare Function gsapi_revision Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal pGSRevisionInfo As Long, ByVal intLen As Long) As Long
-
Private Declare Function gsapi_new_instance Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByRef lngGSInstance As Long, ByVal lngCallerHandle As Long) As Long
-
Private Declare Function gsapi_set_stdio Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal lngGSInstance As Long, ByVal gsdll_stdin As Long, ByVal gsdll_stdout As Long, ByVal gsdll_stderr As Long) As Long
-
Private Declare Sub gsapi_delete_instance Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal lngGSInstance As Long)
-
Private Declare Function gsapi_init_with_args Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal lngGSInstance As Long, ByVal lngArgumentCount As Long, ByVal lngArguments As Long) As Long
-
Private Declare Function gsapi_run_file Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal lngGSInstance As Long, ByVal strFileName As String, ByVal intErrors As Long, ByVal intExitCode As Long) As Long
-
Private Declare Function gsapi_exit Lib "C:\Program Files\gs\gs8.54\bin\gsdll32.dll" (ByVal lngGSInstance As Long) As Long
-
-
'------------------------------------------------
-
'API Calls End
-
'------------------------------------------------
-
-
-
-
-
-
'------------------------------------------------
-
'UDTs Start
-
'------------------------------------------------
-
Private Type GS_Revision
-
strProduct As Long
-
strCopyright As Long
-
intRevision As Long
-
intRevisionDate As Long
-
End Type
-
'------------------------------------------------
-
'UDTs End
-
'------------------------------------------------
-
-
-
-
-
-
'------------------------------------------------
-
'User Defined Functions Start
-
'------------------------------------------------
-
-
-
-
-
Public Function CallGS(ByRef astrGSArgs() As String) As Boolean
-
Dim intReturn As Long
-
Dim intGSInstanceHandle As Long
-
Dim aAnsiArgs() As String
-
Dim aPtrArgs() As Long
-
Dim intCounter As Long
-
Dim intElementCount As Long
-
Dim iTemp As Long
-
Dim callerHandle As Long
-
Dim ptrArgs As Long
-
-
' Print out the revision details.
-
' If we want to insist on a particular version of Ghostscript
-
' we should check the return value of CheckRevision().
-
'CheckRevision (704)
-
-
' Load Ghostscript and get the instance handle
-
intReturn = gsapi_new_instance(intGSInstanceHandle, callerHandle)
-
If (intReturn < 0) Then
-
CallGS = False
-
Return
-
End If
-
-
' Capture stdio
-
intReturn = 0 'gsapi_set_stdio(intGSInstanceHandle, AddressOf gsdll_stdin, AddressOf gsdll_stdout, AddressOf gsdll_stderr)
-
-
If (intReturn >= 0) Then
-
' Convert the Unicode strings to null terminated ANSI byte arrays
-
' then get pointers to the byte arrays.
-
intElementCount = UBound(astrGSArgs)
-
ReDim aAnsiArgs(intElementCount)
-
ReDim aPtrArgs(intElementCount)
-
-
For intCounter = 0 To intElementCount
-
aAnsiArgs(intCounter) = StrConv(astrGSArgs(intCounter), vbFromUnicode)
-
aPtrArgs(intCounter) = StrPtr(aAnsiArgs(intCounter))
-
Next
-
ptrArgs = VarPtr(aPtrArgs(0))
-
-
intReturn = gsapi_init_with_args(intGSInstanceHandle, intElementCount + 1, ptrArgs)
-
-
' Stop the Ghostscript interpreter
-
gsapi_exit (intGSInstanceHandle)
-
End If
-
-
' release the Ghostscript instance handle
-
gsapi_delete_instance (intGSInstanceHandle)
-
-
If (intReturn >= 0) Then
-
CallGS = True
-
Else
-
CallGS = False
-
End If
-
-
End Function
-
-
Private Function ConvertFile(newfilepdf, newfile) As Boolean
-
Dim astrArgs(11) As String
-
astrArgs(0) = "ps2pdf" 'The First Parameter is Ignored
-
astrArgs(1) = "-q"
-
astrArgs(2) = "-dNOSAFER"
-
astrArgs(3) = "-dUseCropBox"
-
astrArgs(4) = "-dNOPAUSE"
-
astrArgs(5) = "-dBATCH"
-
astrArgs(6) = "-sOutputFile=" & newfilepdf
-
astrArgs(7) = "-sDEVICE=pdfwrite"
-
astrArgs(8) = "-c"
-
astrArgs(9) = ".setpdfwrite"
-
astrArgs(10) = "-f"
-
astrArgs(11) = newfile
-
ConvertFile = CallGS(astrArgs)
-
End Function
-
-
-
-
-
'------------------------------------------------
-
'User Defined Functions End
-
'------------------------------------------------
-
-
Sub Main(newfilepdf, newfile)
-
'Call ConvertFile
-
Call ConvertFile(newfilepdf, newfile)
-
'Call TestGS
-
'MsgBox ("Done")
-
End Sub
-
-
newfilepdf is the PDF that's created on the fly
newfile is the postscript file sent
(yes, I know it's a bit backwards)
Basically It calls ghostscript through its API, send a postscript stream and output a PDF. Like I said this work fine when I use this DLL in a VB app, but not in asp.
Any help is appreciated.
Thanks!
3 2267
Didn't see an edit button...
Anyway, I guess I was kind of vague when I said that "it didn't work", what I get when i check the system log is,
"The description for Event ID ( 10021 ) in Source ( DCOM ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: {A9E69610-B80D-11D0-B9B9-00A0C922E750}."
Which from all the googling I've done keeps telling me its permissions on numerous,various, files. However, I can't help but think that the error above indicates an inability to locate my DLL.
I would bet it is permissions, since that is one of the only things that VB will run different from IIS- by default everything that IIS does goes through user "iuser" rather than the machine's user which VB uses (note my highly technical jargon). Just to be sure, I'll ask some IIS experts to weigh in.
Jared
Can you run asp pages? Which version of IIS runing? If IIS6 allow asp web extensions, otherwise prob not an IIS prob. HTH.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Neil Zanella |
last post by:
Hello,
In Python, classes are objects. But there is no way to custom print a class
object. This would require some syntax such as the one commented out below:
With the current "foo =...
|
by: Phil |
last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and
made into a TIF file and placed on the client (could be in temp internet
dir). The reason we need it in TIF format is...
|
by: Charles |
last post by:
I need to find a way to share information between two classes, one is an
employee class and the other is a custom error class that inherits from
ApplicationException. These two classes are part of...
|
by: Noel |
last post by:
Hello,
I'm currently developing a web service that retrieves data from an employee
table. I would like to send and retrieve a custom employee class to/from the
webservice. I have currently coded...
|
by: tekhneek |
last post by:
I'm building a site for my family & friends to all keep in touch and
the two features I'm coming to a halt about is this (in database
design)
I let users create their own pages (with a title and...
|
by: junk |
last post by:
Senerio:
I have a custom user control which contains two control arrays. The user
control has a group box in which the two control arrays are dynamically
built. The two control arrays are...
|
by: Rich Squid |
last post by:
Hello
Here's my basic problem:
On my asp.net form page I have a DetailsView (default mode=edit) bound
to a AccessDataSource control. Users can successfuly update a databound
template field,...
|
by: Peted |
last post by:
Im using c# 2005 express edition
Ive pretty much finished an winforms application and i need to
significantly improve the visual appeal of the interface.
Im totaly stuck on this and cant seem...
|
by: Linda Liu[MSFT] |
last post by:
Hi Moondaddy,
I downloaded your sample project and run it and did see the problem on my
side.
There're three problems in the source code of your project.
1. You should move the following...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |