#if !defined(AFX_CHATDLG_H__8E1066E4_AA1F_4722_96AD_BB2318308B74__INCLUDED_)
#define AFX_CHATDLG_H__8E1066E4_AA1F_4722_96AD_BB2318308B74__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChatDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CChatDlg dialog
#include "afxtempl.h"
#include "AutoRichEditCtrl.h"
#include "Richole.h"
#include "ChPicFrm.h"


class CClientDlg;

class CChatDlg : public CDialog
{
// Construction
public:
	CChatDlg(CWnd* pParent = NULL);   // standard constructor
	
	CAutoRichEditCtrl m_ctlRichText;
	CAutoRichEditCtrl m_ctlRichTextView;

	LPRICHEDITOLE	m_pRichEditOle;
	LPOLEOBJECT	m_lpObject;
	LPSTORAGE         m_lpStorage;
	LPOLECLIENTSITE	m_lpClientSite;

	LPRICHEDITOLE	m_pRichEditOle_msg;
	LPOLEOBJECT	m_lpObject_msg;
	LPSTORAGE         m_lpStorage_msg;
	LPOLECLIENTSITE	m_lpClientSite_msg;

	BOOL CreateFromFile(LPCTSTR lpszFileName);
	BOOL CreateFromFile_msg(LPCTSTR lpszFileName);	

	BOOL InsertPic(LPCTSTR lpszFileName);
	BOOL InsertPic_msg(LPCTSTR lpszFileName);

	void ShowRichMSG(CString );
	void AddRichMSG( CString , CString );
	void FacePicSelect(int );
	void InsColor(CString& strMsg);
	void SetBitmap (UINT ResID, int Type);
	BOOL IsWndCreat;
	CString RTFtemp;
	CChPicFrm* m_pWndFrmPic;
	
// Dialog Data
	//{{AFX_DATA(CChatDlg)
	enum { IDD = IDD_CHATROOM };
	CRichEditCtrl	m_ChatEdit;
	CListBox	m_UserList;
	//}}AFX_DATA

//*************************************************
	CString	m_Send;
	BOOL m_bFirst;
//*************************************************

	//CList<CString, CString&> m_Param;
	void SetParent(CClientDlg* pParent);
	CClientDlg* m_pParent;
	CString m_Roomname;
	void ShowMsgFrom(CString strMan, CString strMsg);
	void ShowMsgTo(CString strMsg);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChatDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CChatDlg)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnButtonSend();
	afx_msg void OnButtonLeave();
	afx_msg void OnDblclkListUser();
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonInspic();
	afx_msg void OnButtonOpen();
	afx_msg void OnButtonSave();
	afx_msg void OnButtonColor3();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnButtonBold2();
	afx_msg void OnButtonItalic2();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	int mType; 
	CBrush mHollowBrush;  
	CBitmap mBitmap;  
	int flag;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHATDLG_H__8E1066E4_AA1F_4722_96AD_BB2318308B74__INCLUDED_)
