Thread: Debugger: Unhandled Exception: User Breakpoint

  1. #1
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972

    Debugger: Unhandled Exception: User Breakpoint

    I had a problem with my program crashing, so I went to debug it. Now, I've let this project sit around for a while, so I don't remember how long it's been since I used the debugger with it. In any case, now when I try to debug it, all I get is an error:
    Unhandled exception at 0x798661d0 in Crypto Tool.exe: User breakpoint.
    I did a search on this error and it sounds like it means I'm corrupting the heap somehow, but hardly any code even runs before it. Here's everything that runs:
    Code:
    //main.cpp
    int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
    {
      g_hinst = hInstance;
    if(!MainWin.Init(hInstance, WinProc))
      return 0;
    return MainWin.Run();
    
    }
    
    //in base.cpp
    bool Winbase::Init(HINSTANCE hinst, WNDPROC WinProc)
    {
     
     m_hinst = hinst;
     INITCOMMONCONTROLSEX icc;
     icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
     icc.dwICC = ICC_BAR_CLASSES;
     InitCommonControlsEx(&icc);
    
     //load rich edit library
     if(!LoadLibrary("riched20.dll"))
     {
      MessageBox(NULL,"Could not load riched20.dll!","Error!",MB_OK|MB_ICONEXCLAMATION);
      return false;
     }
     
     //Load up DLL files
     LoadDLLs();
    
    //...the rest never runs
    
    }
    
    void Winbase::LoadDLLs()
    {
      if(!dllLoad.AddDLL("DLL\\Blowfish.dll"))
        MessageBox(NULL,"Blowfish.dll","Failure to load module:",MB_OK);
    
    }
    
    //In DllLoad.cpp
    bool Loader::AddDLL(LPCTSTR filename)
    {
      HMODULE hDLL = LoadLibrary(filename);//when I hit this line, my error occurs
      if (!hDLL)
        return 0;
    
      DLLInfo di(hDLL);
      
      if(di.fail()) //error initializing
        return 0;
      
      DLL.push_back(di); //add info for this DLL
      DLLCount++;
    
      return 1;
    }
    I've looked it over several times and I just don't see any mistakes. Of course, usually when I post questions like these it turns out to be something silly, so hopefully that's the case
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  2. #2
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    It seems like there was a problem with my DLL. I created it without an entry point, but didn't specify /NOENTRY in the linker options. When I specified /NOENTRY I got a linker error:
    LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
    So I did a google search and found out that a solution to that problem was to add __DllMainCRTStartup@12 to Force Symbol References (/INCLUDE:"__DllMainCRTStartup@12") Don't really understand that but it works
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging and unhandled exception
    By Overlord in forum Windows Programming
    Replies: 2
    Last Post: 07-25-2008, 06:39 AM
  2. Linked List: Unhandled Exception
    By wbeasl in forum C++ Programming
    Replies: 3
    Last Post: 04-15-2004, 02:03 PM
  3. Unhandled exception: User breakpoint
    By glUser3f in forum C++ Programming
    Replies: 3
    Last Post: 10-02-2003, 04:20 PM
  4. comparing user input
    By lambs4 in forum C Programming
    Replies: 5
    Last Post: 12-15-2002, 10:28 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM