MSDN:
Return Value
A pointer to the given control or child window. If no control with the integer ID given by the nID parameter exists, the value is NULL.
The returned pointer may be temporary and should not be stored for later use.
返回的是一个临时的CWnd指针,
因此可能下面这样的做法是可能达不到语气的效果哦:
if(pWnd == GetDlgItem(IDC_EDIT_UPDATE_ITEM))
换成这样就OK了:
if(pWnd->GetDlgCtrlID() == IDC_EDIT_UPDATE_ITEM)
所有评论(0)