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

ε祈祈猫儿з 提交于 2019-12-11 09:46:27

问题


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


回答1:


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.




回答2:


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




回答3:


The other answers are good, but there's always old reliable Sleep() - you insert Sleep() 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 after Sleep() returns execution is stopped on the next statement.

Nothing to setup, but requires recompliling.



来源:https://stackoverflow.com/questions/2409138/dllregisterserver-error-0xc0000005-c-com-dll-how-do-i-debug-my-dllregister

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!