ASP Calling ISAPI DLL

Discussion in 'ASP General' started by Prabhat, Feb 3, 2006.

  1. Prabhat

    Prabhat Guest

    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
    Prabhat, Feb 3, 2006
    #1
    1. Advertising

  2. 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.
    //

    "Prabhat" <> wrote in message
    news:%...
    > 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
    >
    >
    David Wang [Msft], Feb 3, 2006
    #2
    1. Advertising

  3. Prabhat

    Prabhat Guest

    "David Wang [Msft]" <> wrote in message
    news:...
    > 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


    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
    Prabhat, Feb 3, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2aWQgUmV5bm9sZHM=?=

    Is it possible to create an ISAPI dll using VB.Net?

    =?Utf-8?B?RGF2aWQgUmV5bm9sZHM=?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,802
    Juan T. Llibre
    Mar 14, 2005
  2. Zubair.NET!
    Replies:
    1
    Views:
    3,310
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jun 12, 2006
  3. netzorro

    ISAPI DLL Location help

    netzorro, Apr 20, 2006, in forum: C++
    Replies:
    1
    Views:
    1,023
    Victor Bazarov
    Apr 20, 2006
  4. Damien
    Replies:
    5
    Views:
    589
    Damien
    Mar 17, 2008
  5. Prabhat

    ASP Calling ISAPI DLL

    Prabhat, Feb 2, 2006, in forum: ASP General
    Replies:
    0
    Views:
    98
    Prabhat
    Feb 2, 2006
Loading...

Share This Page