//-------------------------------------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TSendCommandEdit 类 // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TSendCommandEdit 定义 // = Maintainers: // //-------------------------------------------------------------------------------------------------------+ #include "StdAfx.h" #include "TSendCommandEdit.h" TSendCommandEdit::~TSendCommandEdit() { } void TSendCommandEdit::Create(const TCHAR *s) { if(GetSafeHwnd() != NULL) { DestroyWindow(); } m_sCommand = s; if(m_sCommand != _T("")) { if(CEdit::Create(0,CRect(0,0,100,100),AfxGetMainWnd(),0)) { SetTimer(1,0,NULL); } } } BEGIN_MESSAGE_MAP(TSendCommandEdit,CEdit) ON_WM_TIMER() END_MESSAGE_MAP() void TSendCommandEdit::OnTimer(UINT_PTR nIDEvent) { CEdit::OnTimer(nIDEvent); DestroyWindow(); CString temp(_T("0")); temp.SetAt(0,8);//退格键 acedPostCommand(temp + m_sCommand + CString(_T("\n"))); CWnd* pWnd = acedGetAcadDwgView(); if(pWnd != NULL) { pWnd->SetFocus(); } }