⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conversationthread.cpp

📁 vc++6.0开发网络典型应用实例导航 1. 本光盘提供了本书中所有的实例源程序文件。 2. 附录文件夹下是Winsock 函数参考以及错误码列表
💻 CPP
字号:
// ConversationThread.cpp : implementation file
//

#include "stdafx.h"
#include "Netmsg.h"
#include "ConversationThread.h"
#include "Conversation.h"
#include "Contact.h"
#include "ContactView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

//The thread that drives the conversation dialog

IMPLEMENT_DYNCREATE(CConversationThread, CWinThread)

CConversationThread::CConversationThread(CContact *With, char *DefaultMsg)
{
	pszDefaultMsg = DefaultMsg;
	pWith = With;
	Conv = NULL;
}

CConversationThread::~CConversationThread()
{
}

BOOL CConversationThread::InitInstance()
{
	Conv = new CConversation(NULL, pWith, pszDefaultMsg);
	m_pMainWnd = Conv;
	Conv->DoModal();
	delete Conv;
	::SendMessage(GetApp()->View->GetSafeHwnd(), WM_DESTROYME, 0, (LPARAM) this);
	return TRUE;
}

int CConversationThread::ExitInstance()
{
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CConversationThread, CWinThread)
	//{{AFX_MSG_MAP(CConversationThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConversationThread message handlers

BOOL CConversationThread::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CWinThread::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -