Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Activex dll stuck in memory

I am using an activex dll in my asp pages.  The problem is that everytime I need to modify the activex dll i get the error "permission denied" because something is holding onto the dll.  I need to restart the computer each time to free it up.

I have tried closing the browser and stopping Personal Web Server, nothing works.  I can't do anything to that dll until I reboot the machine.

Is there a way to unload this from memory, either manually or through the code?  I have already tried setting the object to nothing in the asp page and that does not work.

Thank you.
0
suzuki
Asked:
suzuki
  • 6
  • 3
  • 2
  • +6
1 Solution
 
jitgangulyCommented:
How are you stopping PWS ?

Go to Control panel, services, choose worlwideweb publishing services and stop and try.

Also close all browser windows and VID (if you use)
0
 
John844Commented:
you will have to close interdev also.  it holds a reference to the dll if you have opened the page referencing the component.
0
 
John844Commented:
sorry jitganguly, I new see you included that in your comment.
John
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jitgangulyCommented:
Hey John,
Good to see you on the list. Great job
0
 
dredgeCommented:
suzuki:

if you are running NT workstation, or Win2K Pro, then i suggest setting up your .dll file in Microsoft Transaction Server. This will let you replace the file without having to stop or start anything.

it takes a minute or two to set up, but it's well worth the effort and will save you time and headaches in the end.
0
 
John844Commented:
Thanks jitganguly.

dredge has a good point, and it is also available with PWS.

you will find this in the nt option pack(even for PWS).
0
 
jitgangulyCommented:
Well, I think his/her problem is to generate the DLL from the VB/VC++ source and MTS will not help in this matter. He/she needs to stop the service. At least for NT opt pack 4 I know I used to have trouble.
MTS will only allow him/her to make a better application
0
 
dredgeCommented:
jit: (honest question - i'm sure you know but i want to ask, in order to let others know)

when you ran MTS with your .dll, did you manually register the dll? (regsvr32 myfile.dll) if you did, then this is where the problem is.

when setting up a dll in MTS, you should not register the dll manually - let MTS do it for you. when you do this, you will be able to replace the file with a newer version without having to stop and start any services. this is one of the biggest reasons i use mts.

but then, i don't have much experience with it on NT 4 - just Win2K.
0
 
jitgangulyCommented:
Well, dredge  let me tell you my experience

I used to write Active X DLL from VB 5/6 and I used to  make DLL from VB itself and then move the DLL to web server, register it there with regsvr32 and put the DLL in MTS.
Now whenever I had to modify that DLL, I had this problem . In the sense after changing and moving it to the web server when I tried to re-register, I had to stop IIS, MTS everything ...
But I am talking about NT 4/option pack4 service pack 4
Don't know about win2k
0
 
suzukiAuthor Commented:
Thanks everyone for all your help but nothing works yet.  Maybe the problem is that I am doing this on a Win98 machine?


0
 
jitgangulyCommented:
suzuki,
Just try closing web site adminstrations from control panel/services and try to recompile the dll
0
 
hongjunCommented:
Close all asp files in InterDev.
Stop PWS
Close all browsers.
Unregister your dll
Re-register your dll
Restart your computer

hongjun
0
 
hongjunCommented:
Sorry did not read your question carefully that you actually do not want to reboot your machine.

hongjun
0
 
puranik_pCommented:
On IIS, you just have to stop IIS to free and unregister dll.
but my friend, in case of PWS there is no other solution than restarting the system itself.
the only solution i can think of is..
Use IIS and NT if possible.
0
 
CJ_SCommented:
I am surprised that nobody has shown the exact syntax to stop the real PWS service.

For IIS you can type the following in the Run-dialog to stop IIS and unload the activex dll.
net stop iisadmin
and starts again using:
net start w3svc -e

For PWS you should type:
net stop w3svc
net start w3svc

Now your dll should also be freed.

Regards,
CJ
0
 
CJ_SCommented:
Another way you can debug your activex control / component is by running it in the IDE. For example if you are creating an activex dll, and you want to debug it. Set the project's properties correctly (run in browser, and point to the correct url where the dll is being used). Start the dll, and it will go to the url you have specified. As you can see the dll will be used which is running in the IDE. WHen you stop the component in the IDE, you can debug it further, and start again. This way you don't have to worry about stopping and starting the WWW service.

Regards,
CJ
0
 
Droby10Commented:
one thing that hasn't been addressed is the possiblity of two-way binding outside of the dll to other libraries and services (bad idea anyway, but it happens)...

stopping iis/pws/mts etc. will only release the object instances it's created from the iis/pws context...but if any of those objects are shared with external libraries, those objects would continue to exist and continue to lock the dll.

if this is what is going on the best programming practice is to create and release at a function/method scope; not on an object or application scope.  this means avoiding setting persistent objects within the session or application contents as well.
0
 
jitgangulyCommented:
CJ_S,
Stopping IIS from Control panel/services is same as issuing net stop ...
Therefore I did not mention that
0
 
MoondancerCommented:
I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
 
If there are questions in this regard, please comment and I'll return when I can.
 
The HELP DESK link on the left is informative, and includes this site's Guidelines and Member Agreement as well as assistance related to Questions and Answers.  Here is the QA link, as a reference.
 
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp
 
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 6
  • 3
  • 2
  • +6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now