关于书上的一段代码求解
书上的代码“
全局类
class CGlobal
{
public:
CUsers curUser;
CGlobal();
virtual ~CGlobal();
};
因为StdAfx.h默认包含在很多程序中,所以在StdAfx.h中添加包含该全局类的头文件,在程序中直接访问curUser对象,在访问之前要要添加如下命令引入外部变量
extern CUsers curUser;”
为什么我在StdAfx.h添加头文件不成功?
我的代码
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
extern CUser curUser;
#include "Global.h"
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
rename_namespace("ADOCG") rename("EOF", "EndOfFile") rename("BOF", "BeginOfFile")
using namespace ADOCG;
//#include<adoid.h>
//#include<adoint.h>
//#include"icrsint.h"
#endif // _AFX_NO_AFXCMN_SUPPORT
extern CUsers curUser怎么用??