locked
Error registering and referencing dll RRS feed

  • Question

  • Hello,

    I have been using an integration between VB6 and VB.NET. Until now, I have not had any problem registering files and referencing them. I have been recompiling my VB6 code over and over, and rereferencing it in .NET without any issue.

    However, last time that I referenced a file in .NET, it does not want to create an object that calls a COM component. It gives this error

    "An unhandled exception of type 'System.UnauthorizedAccessException' occurred in NET Tutorial.exe

    Additional information: Retrieving the COM class factory for component with CLSID {50229CB7-1BD4-4F68-BBFA-6BCC43E74A9F} failed due to the following error: 80070005"

    I already tried to unregister the code and register it again, but it is giving me this other error: "LoadLibrary ('........dll') failed - Access is denied.

    Any ideas why is happening this?

    Thank you
    Friday, July 17, 2009 7:45 PM

Answers

  • Whenever you crash a program that is loading a DLL that you wrote, and are registering the COM portion for in this manner...you need to reboot your machine because the DLL is still in memory, and orphaned. (The application that loaded it is now gone, and cannot unload it, you are stuck with the DLL until you reboot, or otherwise apply a strong-arm technique to kill the DLL. Rebooting is just an easier fix.)
    • Marked as answer by Xingwei Hu Thursday, July 23, 2009 3:27 AM
    Monday, July 20, 2009 3:33 PM
  • Use the Process Explorer utility to find the process that has the DLL loaded in memory. Then either close the app or kill the process.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Xingwei Hu Thursday, July 23, 2009 3:27 AM
    Monday, July 20, 2009 3:52 PM

All replies

  • Whenever you crash a program that is loading a DLL that you wrote, and are registering the COM portion for in this manner...you need to reboot your machine because the DLL is still in memory, and orphaned. (The application that loaded it is now gone, and cannot unload it, you are stuck with the DLL until you reboot, or otherwise apply a strong-arm technique to kill the DLL. Rebooting is just an easier fix.)
    • Marked as answer by Xingwei Hu Thursday, July 23, 2009 3:27 AM
    Monday, July 20, 2009 3:33 PM
  • Use the Process Explorer utility to find the process that has the DLL loaded in memory. Then either close the app or kill the process.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Xingwei Hu Thursday, July 23, 2009 3:27 AM
    Monday, July 20, 2009 3:52 PM