outpthrd.cpp

来自「侯捷先生翻译的书籍《Win32多线程程序设计》的源代码。」· C++ 代码 · 共 57 行

CPP
57
字号
/*
 * OutpThrd.cpp
 *
 * Sample code for "Multithreading Applications in Win32"
 * This is from Chapter 11. This sample is discussed in
 * the text, but there is no associated listing.
 *
 * Launch a dialog in another thread using both
 * MFC and Win32. Demonstrate the related problems.
 */

#include "stdafx.h"
#include "Cancel.h"
#include "OutpThrd.h"
#include "OutDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// COutputCancelDlgThread

IMPLEMENT_DYNCREATE(COutputCancelDlgThread, CWinThread)

COutputCancelDlgThread::COutputCancelDlgThread()
{
}

COutputCancelDlgThread::~COutputCancelDlgThread()
{
}

BOOL COutputCancelDlgThread::InitInstance()
{
	m_pDlg->Go();

	return TRUE;
}

int COutputCancelDlgThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	return CWinThread::ExitInstance();
}

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

/////////////////////////////////////////////////////////////////////////////
// COutputCancelDlgThread message handlers

⌨️ 快捷键说明

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