Announcement

Collapse
No announcement yet.

DLL Host is locking PB COM DLL after VBSCRIPT that calls it has completed.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DLL Host is locking PB COM DLL after VBSCRIPT that calls it has completed.

    Not sure how this is supposed to work but, I have a dll created with a method called save. Compiled, registered and works just fine. I have created a vbs file:

    Code:
    Dim o
    
    Set o = CreateObject("FOO")
    
    o.Save
    
    Set o = nothing
    When I double click on the vbs file it runs fine, save has a message box that says save. It does nothing other than that. Now when I go to recomplile the file is locked. The file is being locked by dllhost.exe and is never released. Funny thing is the same functional vb dll never spawns dll host and once the script has completed the file is not locked.
    Sr. Software Development Engineer and Sr. Information Security Analyst,
    CEH, Digital Forensic Examiner

  • #2
    Hi Thomas,

    I found a little snippet in the 'Microsoft Office 2000 automation Help file' which might be relevant.

    The help file is available for download at...

    http://support.microsoft.com/kb/260410

    Topics... Automation is... Destroying Automation Objects...

    Note that with some Automation Servers, setting an object variable to Nothing doesn’t necessarily close the server application. If you're using the CreateObject function to create an instance of an Automation Server, be sure to use a method defined by the Server to quit it if possible and then set the object variable to Nothing. If not, your code may be leaving multiple sessions of the Automation server open. This is very common when automating Microsoft Excel, for instance.
    Perhaps creating and calling a quit method in your dll will remove the lock.

    David

    Comment


    • #3
      Thanks David,

      This documentation actually got me in the correct location. The problem was I had added the pb com component to COM+ to see if it works. In this case it was perfectly acceptable to start the COM Server, get it running and keep the Object in a Created State (not instantiated) until COM+ was shutdown.
      Sr. Software Development Engineer and Sr. Information Security Analyst,
      CEH, Digital Forensic Examiner

      Comment

      Working...
      X