Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ChatClientView.cpp
Package: anywhere.zip [view]
Upload User: zhenhuadz
Upload Date: 2007-01-07
Package Size: 1511k
Code Size: 2k
Category:
Remote Control
Development Platform:
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;
- }