I'm using Visual Studio to debug an ATL application.
When I step over return TRUE
in this code, the error occurs:
BOOL CMainFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) {
// Code snipped from here - maybe this causes stack/heap corruption?
// I have a breakpoint here, if I step over (F10), AFX trace message
// is shown (as below)
return TRUE;
}
This is the message box that's shown:
Windows has triggered a breakpoint in foobar.exe.
This may be due to a corruption of the heap, which indicates a bug in foobar.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while phonejournal.exe has focus.
The output window may have more diagnostic information.
The message is a little vague, and I'm wondering what tools I can use to get more information. The debugger breaks on the call to AtlTraceVU
in atltrace.h
:
inline void __cdecl CTrace::TraceV(const char *pszFileName, int nLine,
DWORD_PTR dwCategory, UINT nLevel, LPCWSTR pszFmt, va_list args) const
{
AtlTraceVU(m_dwModule, pszFileName, nLine, dwCategory, nLevel, pszFmt, args);
}