- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
ChatClientView.cpp
资源名称:anywhere.zip [点击查看]
上传用户:zhenhuadz
上传日期:2007-01-07
资源大小:1511k
文件大小:2k
源码类别:
远程控制编程
开发平台:
Visual C++
- // ChatClientView.cpp : implementation file
- //
- #include "stdafx.h"
- #include "AnyServer.h"
- #include "ChatClientView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #include "AnyServerDoc.h"
- #include "ChatSock.h"
- /////////////////////////////////////////////////////////////////////////////
- // CChatClientView
- #include "ChatView.h"
- IMPLEMENT_DYNCREATE(CChatClientView, CEditView)
- CChatClientView::CChatClientView()
- {
- }
- CChatClientView::~CChatClientView()
- {
- }
- BEGIN_MESSAGE_MAP(CChatClientView, CEditView)
- //{{AFX_MSG_MAP(CChatClientView)
- ON_WM_KEYDOWN()
- ON_WM_KILLFOCUS()
- ON_WM_CTLCOLOR_REFLECT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CChatClientView drawing
- void CChatClientView::OnDraw(CDC* pDC)
- {
- CAnyServerDoc* pDoc = (CAnyServerDoc*)GetDocument();
- }
- /////////////////////////////////////////////////////////////////////////////
- // CChatClientView diagnostics
- #ifdef _DEBUG
- void CChatClientView::AssertValid() const
- {
- CEditView::AssertValid();
- }
- void CChatClientView::Dump(CDumpContext& dc) const
- {
- CEditView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CChatClientView message handlers
- void CChatClientView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- if (nChar==VK_RETURN)
- {
- GetWindowText(((CAnyServerDoc*)GetDocument())->m_Client);
- TRY
- {
- *(((CAnyServerDoc*)GetDocument())->m_pConnect->m_pArchiveOut)<<((CAnyServerDoc*)GetDocument())->m_Client;
- ((CAnyServerDoc*)GetDocument())->m_pConnect->m_pArchiveOut->Flush();
- }
- CATCH(CFileException,e)
- {
- ((CAnyServerDoc*)GetDocument())->m_pConnect->m_pArchiveOut->Abort();
- AfxMessageBox("Send Message Error!");
- }
- END_CATCH
- }
- CEditView::OnKeyDown(nChar, nRepCnt, nFlags);
- }
- void CChatClientView::OnInitialUpdate()
- {
- CEditView::OnInitialUpdate();
- GetEditCtrl().LimitText(4096);
- }
- void CChatClientView::OnKillFocus(CWnd* pNewWnd)
- {
- CEditView::OnKillFocus(pNewWnd);
- if (pNewWnd!=NULL&&pNewWnd->IsKindOf(RUNTIME_CLASS(CChatView))) SetFocus();
- }
- HBRUSH CChatClientView::CtlColor(CDC* pDC, UINT nCtlColor)
- {
- HBRUSH hBrush=(HBRUSH)::GetStockObject(WHITE_BRUSH);
- // TODO: Return a non-NULL brush if the parent's handler should not be called
- return hBrush;
- }