readme.wzd

来自「MFC扩展编程实例」· WZD 代码 · 共 36 行

WZD
36
字号
/////////////////////////////////////////////////////////////////////
// Modify any class.
/////////////////////////////////////////////////////////////////////

// 1) implement a member function of a class
int CWzdView::ViewFunc(int i,LPCSTR s,BOOL b)
{
	i;s;b;		//values are processed
	return 0;	//result is returned
}

// 2) define a variable type that defines this member function
typedef int (CWzdView::*PMFUNC)(int,LPCSTR,BOOL);

NOTE: PMFUNC above becomes the variable type name


// 3) when using this new variable type, you must also include a variable
// that points to the class that this function belongs to
void CWzdUtil::Perform(CWzdView *pClass, PMFUNC func)
{
		:	:	:
}

// 4) to use this new variable type 
void CWzdUtil::Perform(CWzdView *pClass, PMFUNC func)
{
	int i=(pClass->*func)(1,"test",TRUE);


/////////////////////////////////////////////////////////////////////
// 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 + -
显示快捷键?