本文介绍了项目仅在调试模式下引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,直到最近才在Visual Studio 6.0中进行了编译,没有任何问题.我将此项目移到了Visual Studio2008.
在调试和发布模式下都可以正确编译.

它打开一个MS Access数据库文件并访问一个表.

它在发布模式下工作正常,但是当我尝试在调试模式下运行项目时,它将引发异常.在访问表后发生异常,我尝试移至下一条记录.

我已经复制了一些表明可能存在问题的输出.

感谢您的帮助.

I have a project that until recently was compiled in Visual Studio 6.0 with no problems. I moved this project to Visual Studio 2008.
It compiles without error in both debug and release mode.

It opens up a MS Access database file and accesses a table.

It works fine in Release Mode, but when I attempt to run the project in Debug mode it throws an exception. The exception occurs after the table is accessed and I attempt to move to the next record.

I have copied some of the output that indicates a possible problem.

Thanks for your help.

'Proj.exe': Loaded 'C:\WINDOWS\system32\odbcint.dll', Binary was not built with debug information.

Warning: ODBC Success With Info, Driver's SQLSetConnectAttr failed
State:IM006,Native : 0,Origin:[Microsoft][ODBC Driver Manager]

DBMS: ACCESS
Version: 04.00.0000
ODBC Driver Manager Version: 03.52.0000
Warning: ODBC Success With Info, String data, right truncated 
State:01004,Native:5,Origin:[Microsoft][ODBC Microsoft Access Driver]

'Proj.exe': Loaded 'C:\WINDOWS\system32\expsrv.dll', Cannot find or open a required DBG file.
Warning: Setting forwardOnly recordset readOnly.

推荐答案



AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) { // special message which identifies the window as using AfxWndProc if (nMsg == WM_QUERYAFXWNDPROC) return 1; // all other messages route through message map 

CWnd* pWnd = CWnd::FromHandlePermanent(hWnd); 
ASSERT(pWnd != NULL); 
ASSERT pWnd==NULL || pWnd->m_hWnd == hWnd); 
if (pWnd == NULL || pWnd->m_hWnd != hWnd) 
     return ::DefWindowProc(hWnd, nMsg, wParam, lParam); 

return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam); 
}


这篇关于项目仅在调试模式下引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 14:15