API calls fail in ASP.Net

G

Guest

I have an unmanaged library that i'm using to generate a .tif image from a
..pdf file. When I run the following code in a console application,
everything works fine. However, when I run it from ASP.Net, I get a stack
overflow exception. If anything, I would have expected a CAS exception - but
am stumped as to the stack overflow exception. Below is the code used to
call the native API.

TIA,

_howard

Private Declare Function SetXY Lib "CP2T.dll" (ByVal resx As Integer,
ByVal resy As Integer) As Integer
Private Declare Function SetBPP Lib "CP2T.dll" (ByVal bpp As Integer) As
Integer
Private Declare Function SetCompress Lib "CP2T.dll" (ByVal compress As
Integer) As Integer
Private Declare Function SetSize Lib "CP2T.dll" (ByVal sizewidth As
Integer, ByVal sizeheight As Integer) As Integer
Private Declare Function PageRange Lib "CP2T.dll" (ByVal firstpage As
Integer, ByVal lastpage As Integer) As Integer
Private Declare Function Convert Lib "CP2T.dll" (ByVal srcPDF As String,
ByVal dstTIFF As String) As Integer

.....

Dim result As Integer
Dim inputfile As String
Dim outputfile As String
result = SetXY(2 * 204, 2 * 98)
result = SetSize(2 * 1728, 2 * 1051)
'Run the conversion
inputfile = "c:\817.pdf"
outputfile = "c:\817.tif"
result = Convert(inputfile, outputfile)
 
M

Mark Fitzpatrick

Are you storing the resultant tif in a file? If so, have you made sure that
the ASPNET user account has permissions to write to the directory? If not,
then you could be thrown an error.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
B

bruce barker

the library may not be thread safe, which is required for asp.net. also
notmally asp.net does not have access to c:\, so it may be a permission
problem.

-- bruce (sqlwork.com)



message | I have an unmanaged library that i'm using to generate a .tif image from a
| .pdf file. When I run the following code in a console application,
| everything works fine. However, when I run it from ASP.Net, I get a stack
| overflow exception. If anything, I would have expected a CAS exception -
but
| am stumped as to the stack overflow exception. Below is the code used to
| call the native API.
|
| TIA,
|
| _howard
|
| Private Declare Function SetXY Lib "CP2T.dll" (ByVal resx As Integer,
| ByVal resy As Integer) As Integer
| Private Declare Function SetBPP Lib "CP2T.dll" (ByVal bpp As Integer)
As
| Integer
| Private Declare Function SetCompress Lib "CP2T.dll" (ByVal compress As
| Integer) As Integer
| Private Declare Function SetSize Lib "CP2T.dll" (ByVal sizewidth As
| Integer, ByVal sizeheight As Integer) As Integer
| Private Declare Function PageRange Lib "CP2T.dll" (ByVal firstpage As
| Integer, ByVal lastpage As Integer) As Integer
| Private Declare Function Convert Lib "CP2T.dll" (ByVal srcPDF As
String,
| ByVal dstTIFF As String) As Integer
|
| ....
|
| Dim result As Integer
| Dim inputfile As String
| Dim outputfile As String
| result = SetXY(2 * 204, 2 * 98)
| result = SetSize(2 * 1728, 2 * 1051)
| 'Run the conversion
| inputfile = "c:\817.pdf"
| outputfile = "c:\817.tif"
| result = Convert(inputfile, outputfile)
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top