// MyEdit.cpp : implementation file // #include "stdafx.h" #include "Resource.h" #include "MyEdit.h" #include "StepDlg.h" #include "BaseStairDlg.h" #include "RectStairDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMyEdit CMyEdit::CMyEdit() { } CMyEdit::~CMyEdit() { } BEGIN_MESSAGE_MAP(CMyEdit, CEdit) //{{AFX_MSG_MAP(CMyEdit) ON_WM_KEYDOWN() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMyEdit message handlers void CMyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default if (nChar == VK_RETURN){ CWnd *pWnd=GetParent(); if (pWnd->IsKindOf(RUNTIME_CLASS(CStepDlg))) { ((CStepDlg *)pWnd)->updateEdit(); return; } /* if (pWnd->IsKindOf(RUNTIME_CLASS(CBaseStairDlg))) { ((CBaseStairDlg *)pWnd)->updateEdit(); return; } if (pWnd->IsKindOf(RUNTIME_CLASS(CRectStairDlg))) { ((CRectStairDlg *)pWnd)->updateEdit(); return; }*/ } CEdit::OnKeyDown(nChar, nRepCnt, nFlags); }