// Users.h: interface for the CUsers class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_USERS_H__6DF2B22F_8C78_4C8D_BEFD_D8C06449DCF2__INCLUDED_)
#define AFX_USERS_H__6DF2B22F_8C78_4C8D_BEFD_D8C06449DCF2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CUsers
{
public:
void SetUser_type(int iUser_type);
int GetUser_type();
void sql_update(CString cUserName);
void sql_insert();
void sql_delete(CString cUserName);
void SetUserName(CString cUserName);
void SetPwd(CString cPwd);
int HaveName(CString cUserName);
CString GetUserName();
CString GetPwd();
void GetData(CString cUserName);
CUsers();
virtual ~CUsers();
private:
int User_type;
CString Pwd;
CString UserName;
};
#endif // !defined(AFX_USERS_H__6DF2B22F_8C78_4C8D_BEFD_D8C06449DCF2__INCLUDED_)
错误如下:
--------------------Configuration: HospitalMan - Win32 Debug--------------------
Compiling...
StdAfx.cpp
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(17) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(19) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(20) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(21) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(22) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(23) : error C2146: syntax error : missing ';' before identifier 'GetUserName'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(23) : error C2501: 'CString' : missing storage-class or type specifiers
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(24) : error C2146: syntax error : missing ';' before identifier 'GetPwd'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(24) : error C2501: 'CString' : missing storage-class or type specifiers
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(25) : error C2061: syntax error : identifier 'CString'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(32) : error C2146: syntax error : missing ';' before identifier 'Pwd'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(32) : error C2501: 'CString' : missing storage-class or type specifiers
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(32) : error C2501: 'Pwd' : missing storage-class or type specifiers
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(33) : error C2146: syntax error : missing ';' before identifier 'UserName'
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(33) : error C2501: 'CString' : missing storage-class or type specifiers
f:\学习工具\vc++\msdev98\myprojects\hospitalman\users.h(33) : error C2501: 'UserName' : missing storage-class or type specifiers
Error executing cl.exe.
HospitalMan.exe - 16 error(s), 0 warning(s)
6 个解决方案
#1
把关AfxStd.h包含进去看看
#2
#include "stdafx.h"
#3
加上 #include "stdafx.h"
#4
加上 #include "afxwin.h",楼上的也行,看看stdafx.h中有没有前面的那一句
#5
可是我已经加上了,还是报一样的错误。
#6
#include <afx.h>
#1
把关AfxStd.h包含进去看看
#2
#include "stdafx.h"
#3
加上 #include "stdafx.h"
#4
加上 #include "afxwin.h",楼上的也行,看看stdafx.h中有没有前面的那一句
#5
可是我已经加上了,还是报一样的错误。
#6
#include <afx.h>