How to break in a DLL

VapiSoft used Ask the Experts™

I have a Hook DLL that is injected to other processes.
I need to debug it.
I placed a DebugBreak in the place where I wanted it to break (to enter the debugger).
Instead of breaking, it just crash in this place.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Does it tell you where it is crashing (line of code?).  Maybe you need to set the debug point earlier in your code.  If you remove the debug point can the whole program run without crashing?  Or is the crash the whole reason you are debugging in the first place?
maybe this will help

BEfore you execute your application, does the breakpoint have a '?' on it? and after you perform LoadLibrary, does it become solid? If so, things are going correctly.

Perhaps you are accessing an older version of the dll in your application, which would lead the application to not execute those break points.

Another suggestion, In your applications properties page, on the Debugging menu, set the debugging type to mixed or native.


1. The quesion about the ? -
    I think you mean a * in the left column (near the line).
    I did not place a breakpoint on the line with F9 because it did not work.
   It is sold before I load the DLL and then it becomes hollow (cirule) after I load the DLL.
   So I thought the DebugBreak() will do the job.

2. I changed the debugging Type from 'Auto' to Native but it didn't help.

I looked in the link but it is same the same thing (you copied it).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial