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