|
The program has no problems in Debug, but an unhandled exception in config.exe: 0xC0000005: Access Violation will appear under Release.
There is a list control in the interface, which contains a line of content. Above this line, double-clicking the event is correct, but if you double-click in the blank space, you will get the above error.
BEGIN_MESSAGE_MAP (CSetODBCDlg, CDialog)
ON_NOTIFY (NM_DBLCLK, IDC_ODBC_BASE_LIST, OnListDbClick) // Double-click list control
END_MESSAGE_MAP ()
void CSetODBCDlg :: OnListDbClick ()
{
POSITION pos = ((CListCtrl *) GetDlgItem (IDC_ODBC_BASE_LIST))-> GetFirstSelectedItemPosition ();
if (pos == NULL) // click on a blank line
{
TRACE0 ("No items were selected!\n");
}
else // click on a non-empty row
{
int nItem = ((CListCtrl *) GetDlgItem (IDC_ODBC_BASE_LIST))-> GetNextSelectedItem (pos);
Ranch
CDirSearchCfgDlg dlg (this, EDirectoryODBC, nItem);
dlg.DoModal ();
}
}
Thank you Niuren for analysis, thank you very much! !! !! |
|