首先是有个窗口Unhandled exception in MCECS-D.exe (MFC42D.dll): 0xc0000005: Access Violation.具体出错地点:int CWnd::GetWindowText(LPTSTR lpszString, int nMaxCount) const ASSERT(::IsWindow(m_hWnd));//这里出错切换一次tab之后,就会在上面地方出错,出错时:
this 0x00000000 {CWnd hWnd=???}p.s.上述的tab是bcg里的tabview
this 0x00000000 {CWnd hWnd=???}p.s.上述的tab是bcg里的tabview
void CCtrlParmView::OnKillfocusEditNN()
{
// TODO: Add your control notification handler code here
GetDlgItem(IDC_EDIT_NN)->GetWindowText(m_relayStr,50);
m_NN = atoi(m_relayStr); //ascii string convert to int
ALL.NN = m_NN;
}
全都是这样的处理函数
void CCtrlParmView::OnKillfocusEditNN()
{
if (!::IsWindow(m_relayStr.m_hWnd)) return; GetDlgItem(IDC_EDIT_NN)->GetWindowText(m_relayStr,50);
m_NN = atoi(m_relayStr); //ascii string convert to int
ALL.NN = m_NN;
}
我把IDC_EDIT_NN这个id写错了。
我怎么让form上的edit之类的控件disable?是要运行时设置
参见http://www.csdn.net/Develop/Read_Article.asp?Id=9490