Search code examples
c++comdlldllregistration

DllRegisterServer error 0xc0000005, (C++ COM Dll). how do I debug my DllRegisterServer function in Visual Studio 2008?


I have written a COM dll, and wish to register it using

regsvr32 myComdll.dll

I get an error :

DllRegisterServer failed, Return code was: 0xc0000005

I want to debug my DllRegsiterServer function, but I do not know how to set up Visual Studio 2008 to run regsvr32 in debug mode...

Thanks

Roey


Solution

  • Project + Properties, Debugging, set Command = Regsvr32.exe $(TargetPath). Set a breakpoint on your DllRegisterServer function or use Debug + Exceptions, check Win32 Exceptions. Press F5 to get it going.