Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ

ActiveX and DLL Creation

Permission Denied error when compiling an ActiveX DLL by bigfoot
Posted: 5 Mar 01

You just created your new VB dll.  
You've created an exe project to try it out.  Like the book says, you create a group to tie them all together.

Wow, it works, now to do some changes....
Recompile(make) and you get this message:
PERMISSION DENIED! c:\..mylib.dll

What's wrong... eh, I know.. regsvr32 mylib.dll /u ... still won't work.  (hair being torn out)

You are not alone, here is what went wrong:

Visual Basic 6 does not unload the ActiveX DLL when running an application in the IDE.
If you have a reference set to the .DLL from your test project (in the group), and then try to recompile the DLL, you will get the Permission Denied error.

Here are all the steps to reproduce this:
  1. Create an ActiveX DLL.
  2. Add a standard EXE to the project group to test the DLL.
  3. Add a reference in the standard EXE to the DLL.
  4. Compile the DLL.
  5. Recompile the DLL. You will now get this error.

*** 5a. Remove the DLL from the group. This resets the reference from the ActiveX DLL project to the DLL itself.

  6. Test again. Things should be fine.
  7. Re-add the DLL to the project group.
  8. Recompile the DLL. You will now get this error.

The work around is to reset the reference from the ActiveX DLL (.dll) to the ActiveX DLL project (.vbp) and then recompile, or you can close the project, and just open the dll project by itself.

This works fine.

Good luck and have fun!

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close