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
The other answers are good, but there's always old reliable
Sleep()
- you insertSleep()
call as the first statement of the function of interest (DllRegisterServer()
in your case) and recompile the project. Then you set a breakpoint into the next statement, run regsvr32 and attach the debugger to it. regsvr32 calls the function and afterSleep()
returns execution is stopped on the next statement.Nothing to setup, but requires recompliling.
1 set regsvr32 as you exe to start
2 Set the arguments in visual studio to be the path to your debug dll
3 set a breakpoint in the register function.
4 Start Debugging
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.