Results 1 to 5 of 5

Thread: ActiveX DLL is not unloaded

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    266

    Angry

    Hi there,
    I have created a ActiveX DLL which displays a modal form. I have called it from an ASP script to display the modal form. Even after I set the object reference to that DLL to nothing, the DLL is not unloaded from memory i.e. when I try to delete or replace that DLL in Windows Explorer it gives me an error message as Permission Denied. The instancing property for the class in that DLL is GlobalMultiuse. What can be solution to this problem? Thanks in advance.

    Code snippet for Activex DLL follows
    'Dialog is the modal form
    'Code in class file Class1
    Private mdlg As Dialog

    Private Sub Class_Initialize()
    Set mdlg = New Dialog
    End Sub

    Private Sub Class_Terminate()
    Unload mdlg
    Set mdlg = Nothing
    End Sub

    Public Function ShowDialog()
    mdlg.Show vbModal
    End Function


    Code snippet for ASP script
    <HTML>
    <BODY>
    <%
    Response.write("Begining of DLL access<BR>")
    Dim MyObj
    Set MyObj=Server.CreateObject("Trash.Class1")
    MyObj.ShowDialog
    Response.write("End of DLL access")
    Set MyObj=Nothing
    %>
    </BODY>
    </HTML>

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Yeah, It's a pain isn't it!

    Re-booting your PC will force the dll to be released

    alternatively, put this into a batch file and run it when you need the components to be released
    Code:
    @echo off
    NET STOP iisadmin /y
    MTXSTOP
    NET START W3SVC
    sometimes only a re-boot will work though!

    take a look at this article as well

    http://www.vbsquare.com/articles/aspdev/
    Mark
    -------------------

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    why do you have a form in your DLL?

  4. #4
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    Yea I've had the exact same problem, what I do is I write my ActiveX dll, and debug it in a different VB project, so that I can work with it there, and get it upto shape, then when I am convident I got that, then adding the DLL on the webserver, then start developing an ASP to work with it, so far the only best method I've found is rebooting the machine, however, before using the DLL , create your webstie on the IIS machine, then goto the IIS manager, right click your site, and there should be a check box on one of the tabs that says something like give the site it's own memory space, this way when that site is not in use, it free's its own memory, IIS by default makes a copy of everything in memory, making the web applicatino use it's owm memory space, might or might not fix that.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  5. #5
    New Member
    Join Date
    Oct 2002
    Location
    Netherlands
    Posts
    13

    unloading dlls

    Thanks, Mark, the batch file works.

    A bit late, I know, but that's the good thing of forums
    *Presses your nose* "Tooooot!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width