readme.wzd

来自「The programs and applications on this di」· WZD 代码 · 共 54 行

WZD
54
字号
/////////////////////////////////////////////////////////////////////
// Example files.
/////////////////////////////////////////////////////////////////////

WzdThrd.cpp -- a worker thread class which signals it's done with a 
WzdThrd.h			windows message.

/////////////////////////////////////////////////////////////////////
// Modify any class which can receive a windows message.
/////////////////////////////////////////////////////////////////////

// 1) embed thread data structure in a class or make static
// (will be used to communicate with the thread)
	THREADDATA ThreadData;

// 2) initialize data structure
	ThreadData.nData=123;
	ThreadData.hDoneWnd=m_hWnd; // tell thread where to send message when it's done

// 3) create worker thread
	AfxBeginThread(
		WzdThread,				// static thread process declare (UINT WzdThread( LPVOID pParam );)
		&m_ThreadData);			// data to send to thread

// NOTE: the next few steps are added to receive the "All Done" message back
//  from the worker thread.

// 4) include "afxpriv.h" (to be able to use ON_MESSAGE_VOID message macro

// 5) declare message handler
	//{{AFX_MSG(CWzdView)
	//}}AFX_MSG
	afx_msg void OnDone();
	DECLARE_MESSAGE_MAP()

// 6) add message to message map
// receive message back from thread that it's done
BEGIN_MESSAGE_MAP(CWzdView, CView)
	//{{AFX_MSG_MAP(CWzdView)
	//}}AFX_MSG_MAP
	ON_MESSAGE_VOID(WM_DONE,OnDone)
END_MESSAGE_MAP()

// 7) implement message
void CWzdView::OnDone()
{
}

/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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