www.pudn.com > SimSimens.rar > SimSimensView.cpp


// SimSimensView.cpp : implementation of the CSimSimensView class 
// 
 
#include "stdafx.h" 
#include "SimSimens.h" 
 
#include "SimSimensDoc.h" 
#include "SimSimensView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView 
 
IMPLEMENT_DYNCREATE(CSimSimensView, CEditView) 
 
BEGIN_MESSAGE_MAP(CSimSimensView, CEditView) 
	//{{AFX_MSG_MAP(CSimSimensView) 
	ON_MESSAGE(WM_COMMNOTIFY,OnCommNotify) 
    ON_WM_CHAR() 
	ON_MESSAGE(WM_SHOW_T_STX,Show_T_STX) 
	ON_MESSAGE(WM_SHOW_T_DLE,Show_T_DLE) 
	ON_MESSAGE(WM_SHOW_T_NAK,Show_T_NAK) 
	ON_MESSAGE(WM_SHOW_T_DLEETXBCC,Show_T_DLEETXBCC) 
	ON_MESSAGE(WM_SHOW_R_STX,Show_R_STX) 
	ON_MESSAGE(WM_SHOW_R_DLE,Show_R_DLE) 
	ON_MESSAGE(WM_SHOW_R_NAK,Show_R_NAK) 
	ON_MESSAGE(WM_SHOW_R_DLEETXBCC,Show_R_DLEETXBCC) 
	ON_MESSAGE(WM_SHOW_ZVZ_OUTTIME,Show_ZVZ_OUTTIME) 
	ON_MESSAGE(WM_SHOW_QVZ_OUTTIME,Show_QVZ_OUTTIME) 
	ON_MESSAGE(WM_SHOW_BWA_OUTTIME,Show_BWA_OUTTIME) 
    ON_MESSAGE(WM_SHOW_ZVZ_WAIT,Show_ZVZ_WAIT)                   
    ON_MESSAGE(WM_SHOW_TXA_OVER_STX,Show_TXA_OVER_STX)       
    ON_MESSAGE(WM_SHOW_TXA_OVER_T_TEXT,Show_TXA_OVER_T_TEXT) 
    ON_MESSAGE(WM_SHOW_TXA_OVER_R_TEXT,Show_TXA_OVER_R_TEXT)            
    ON_MESSAGE(WM_SHOW_T_TEXT_SUCCESS,Show_T_TEXT_SUCCESS)             
    ON_MESSAGE(WM_SHOW_T_TEXT_UNSUCCESS,Show_T_TEXT_UNSUCCESS)                   
    ON_MESSAGE(WM_SHOW_R_TEXT_SUCCESS,Show_R_TEXT_SUCCESS)              
    ON_MESSAGE(WM_SHOW_R_TEXT_UNSUCCESS,Show_R_TEXT_UNSUCCESS)            
    ON_MESSAGE(WM_SHOW_CHECKBCC_SUCCESS,Show_CHECKBCC_SUCCESS)            
    ON_MESSAGE(WM_SHOW_CHECKBCC_UNSUCCESS,Show_CHECKBCC_UNSUCCESS)         
    ON_MESSAGE(WM_SHOW_CHECK_SUCCESS,Show_CHECK_SUCCESS)            
    ON_MESSAGE(WM_SHOW_CHECK_UNSUCCESS,Show_CHECK_UNSUCCESS)  
	ON_MESSAGE(WM_SHOW_R_OTHER,Show_R_OTHER) 
	ON_MESSAGE(WM_SHOW_T_A,Show_T_A) 
    ON_MESSAGE(WM_SHOW_R_A,Show_R_A) 
	//}}AFX_MSG_MAP 
	// Standard printing commands 
	ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview) 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView construction/destruction 
 
CSimSimensView::CSimSimensView() 
{ 
	// TODO: add construction code here 
} 
 
CSimSimensView::~CSimSimensView() 
{ 
} 
 
BOOL CSimSimensView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	BOOL bPreCreated = CEditView::PreCreateWindow(cs); 
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping 
 
	return bPreCreated; 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView drawing 
 
void CSimSimensView::OnDraw(CDC* pDC) 
{ 
	CSimSimensDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	// TODO: add draw code for native data here 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView printing 
 
BOOL CSimSimensView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default CEditView preparation 
	return CEditView::OnPreparePrinting(pInfo); 
} 
 
void CSimSimensView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo) 
{ 
	// Default CEditView begin printing. 
	CEditView::OnBeginPrinting(pDC, pInfo); 
} 
 
void CSimSimensView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo) 
{ 
	// Default CEditView end printing 
	CEditView::OnEndPrinting(pDC, pInfo); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView diagnostics 
 
#ifdef _DEBUG 
void CSimSimensView::AssertValid() const 
{ 
	CEditView::AssertValid(); 
} 
 
void CSimSimensView::Dump(CDumpContext& dc) const 
{ 
	CEditView::Dump(dc); 
} 
 
CSimSimensDoc* CSimSimensView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSimSimensDoc))); 
	return (CSimSimensDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CSimSimensView message handlers 
LRESULT CSimSimensView::OnCommNotify(WPARAM wParam,LPARAM lParam) 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
    char show_c=NULL; 
	CString str; 
    int nTextLength; 
	CEdit & edit=GetEditCtrl(); 
	str.Empty(); 
 
	//是否EV_RXCHAR事件? 
	if(!pDoc->m_bConnected || (wParam & EV_RXCHAR)!=EV_RXCHAR) 
	{ 
		//允许发送下一个WM_COMMNOTFY消息 
		SetEvent(pDoc->m_hPostMsgEvent); 
		return 0L; 
	} 
 
    pDoc->ReadComm();    //读串口至接收 
    nTextLength=edit.GetWindowTextLength();   
	//移动插入光标到正文未尾 
    edit.SetSel(nTextLength,nTextLength); 
   	show_c=pDoc->rc; 
     
	if(show_c) 
	{ 
		pDoc->rc=NULL; 
        switch(show_c) 
		{ 
	    case '\r': 
			if(!pDoc->m_bNewLine) 
				break; 
    	case '\n': 
		    str+="\r\n"; 
			break; 
	    case '\b': 
		    edit.SetSel(-1,0); 
		    edit.ReplaceSel(str); 
		    nTextLength=edit.GetWindowTextLength(); 
		    edit.SetSel(nTextLength-1,nTextLength); 
		    edit.ReplaceSel(""); 
		    str=""; 
	    	break; 
	    case '\a': 
		    MessageBeep((UINT)-1); 
		    break; 
	    default: 
		    str+=show_c; 
		} 
 
	/*	if(int(show_c)&128) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&64) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&32) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&16) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&8) 
			str+='1 
		if(int(show_c)&4) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&2) 
			str+='1'; 
		else 
			str+='0'; 
		if(int(show_c)&1) 
			str+='1'; 
		else 
			str+='0'; 
*/ 
	    edit.SetSel(-1,0); 
	    edit.ReplaceSel(str); 
	} 
	//允许发送下一个WM_COMMNOTFY消息 
	SetEvent(pDoc->m_hPostMsgEvent); 
	return 0L; 
} 
 
void CSimSimensView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)  
{ 
	// TODO: Add your message handler code here and/or call default 
	 
	CSimSimensDoc * pDoc=GetDocument(); 
	char c=(char)nChar; 
 
	//如果串口未打开,不进行响应 
	if(!pDoc->m_bConnected) 
		return; 
 
	//向数据存放区写一个字符 
    pDoc->transmit_str[pDoc->transmit_number]=c; 
	pDoc->transmit_number++; 
	 
	//本地回显 
	if(pDoc->m_bEcho) 
		CEditView::OnChar(nChar, nRepCnt, nFlags); 
} 
 
void CSimSimensView::Show_T_STX() 
{ 
    CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_STX); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_DLE() 
{ 
    CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_DLE); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_NAK() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_NAK); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_DLEETXBCC() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
    CString str; 
	str.LoadString(IDS_T_DLEETXBCC); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_STX() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_STX); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_DLE() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_DLE); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_NAK() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_NAK); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_DLEETXBCC() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_DLEETXBCC); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_ZVZ_OUTTIME() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_ZVZ_OUTTIME); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_QVZ_OUTTIME() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_QVZ_OUTTIME); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_BWA_OUTTIME() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_BWA_OUTTIME); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_ZVZ_WAIT() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_ZVZ_WAIT); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_TXA_OVER_STX() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_TXA_OVER_STX); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_TXA_OVER_T_TEXT() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_TXA_OVER_T_TEXT); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_TXA_OVER_R_TEXT() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_TXA_OVER_R_TEXT); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_TEXT_SUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_TEXT_SUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b':				 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_TEXT_UNSUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_TEXT_UNSUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_TEXT_SUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_TEXT_SUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_TEXT_UNSUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_TEXT_UNSUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_CHECKBCC_SUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_CHECKBCC_SUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_CHECKBCC_UNSUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_CHECKBCC_UNSUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_CHECK_SUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_CHECK_SUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_CHECK_UNSUCCESS() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_CHECK_UNSUCCESS); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_OTHER() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_OTHER); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_T_A() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_T_A); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
} 
 
void CSimSimensView::Show_R_A() 
{ 
	CSimSimensDoc * pDoc=GetDocument(); 
	CString str; 
	str.LoadString(IDS_R_A); 
	int nLength=str.GetLength(); 
	char buf[100]; 
	for(int S=0;Sm_bNewLine) 
					break; 
			case '\n': 
				str+="\r\n"; 
				break; 
			case '\b': 
				edit.SetSel(-1,0); 
				edit.ReplaceSel(str); 
				nTextLength=edit.GetWindowTextLength(); 
				edit.SetSel(nTextLength-1,nTextLength); 
				edit.ReplaceSel(""); 
				str=""; 
				break; 
			case '\a': 
				MessageBeep((UINT)-1); 
				break; 
			default: 
				str+=buf[i]; 
			} 
		} 
	edit.SetSel(-1,0); 
	edit.ReplaceSel(str); 
}