ASP Calling ISAPI DLL

P

Prabhat

Hello ALL,

I have ASP pages that calls some ISAPI dll that created using Delphi for
generating reports. The report page opens fine for 1st time when invoked but
next time i get error like "Name not unique in this context."

My quesry string pass to dll like:
.../ReportsDLL/NameOfDLL.dll?PatID=100578&ThpID=12&State=FL

I think after the DLL is loaded it is not freeing the memory and not
unloading the dll from memory. SO How can i free memory used by the DLL or
unload the DLL from within the ASP page that load the url to
window.location?

How can I free the objects / DLL that I loaded from the ASP page using the
above querystring?

Note: I think the delphi code that is written for DLL is working fine as It
works fine for 1st time.

Please suggest and advice.

Thanks
Prabhat
 
D

David Wang [Msft]

How does your ASP "call" an ISAPI DLL? Is it: Server.Exec() ,
Server.Transfer() , or something else.

Unfortunately, your question about freeing/unloading objects/DLL has no
valid answer because your hypothesis about how ISAPI DLL loads/unloads is
incorrect.

Also, your assumption that your Delphi code is fine is also invalid because
suppose your Delphi code calls CoInitialize() every time -- the first time
would succeed but second time would fail.

Let's first figure out your actual code execution sequence before assuming
anything else.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
 
P

Prabhat

David Wang said:
How does your ASP "call" an ISAPI DLL? Is it: Server.Exec() ,
Server.Transfer() , or something else.

Unfortunately, your question about freeing/unloading objects/DLL has no
valid answer because your hypothesis about how ISAPI DLL loads/unloads is
incorrect.

Also, your assumption that your Delphi code is fine is also invalid because
suppose your Delphi code calls CoInitialize() every time -- the first time
would succeed but second time would fail.

Let's first figure out your actual code execution sequence before assuming
anything else.

Hi david,

My ASP file frame the URL like:

<% pageUrl=pageUrl & "?" & Request.QueryString()&"&State=" & UserState %>

<html>
<head>
<title></title>
</head>
<script language="JavaScript">
function loadPage()
{
window.location ="<%=pageUrl%>";
}
</script>
<body onload="loadPage();" >
<table align="center" width="80%" cellspacing="10">
<tr><td width="71%" height="200" align="right" valign="bottom">
<font color="#0000FF" size="5" face="Verdana, Arial, Helvetica,
sans-serif">
<b>Requested Report is loading</b></font>
</td>
<td width="29%" valign="bottom"><img align="bottom"
src="images/loading.gif">
</td></tr>
<tr><td align="center" valign="bottom" colspan="2">
<font color="#0000FF" size="5" face="Verdana, Arial, Helvetica,
sans-serif"><b>Please wait.&nbsp;&nbsp;&nbsp;</b></font>
</td></tr>
</table>
</body>
</html>

====================

If we see what is in the pageUrl we get like:
.../ReportsDLL/DLLName.dll?hidPatID=100578&hidThpID=12&hidSqID=1&hidDocType=2
&tType=PT&State=FL

Here the DLL is a ISAPI DLL created in Delphi 5.0. So here http request is
send to the DLL and the code insite the DLL connect to Interbase DB and
Generate report and prepare as PDF. The reporting tool used is Report
Builder for Delphi and for Conversion it uses Pragnaan components.

I am not sure where I get the problem (which may be inside the Delphi code
also). I get error when I close the report window before it display the
report or 2nd time also. 3rd time it will come and 4th time it wont. So I
think there is something not freeing from memory. The Error Message that I
get is mostly: "Name not unique in this context"

Thanks
Prabhat
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top