Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied error when compiling an ActiveX DLL

ActiveX and DLL Creation

Permission Denied error when compiling an ActiveX DLL

by  bigfoot  Posted    (Edited  )
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! :)
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top