在学vc++,是看着vc++6.0技术内幕做的,但我没有里面附带的光盘,
其中有些例子中只给出了头文件,那我能否照着头文件写出它的源文件呢?
其中有些例子中只给出了头文件,那我能否照着头文件写出它的源文件呢?
解决方案 »
- 不再OnPaint()函数里画图,怎么画?
- 用了ON_COMMAND_RANGE,但按钮都是灰的,怎么Enable他们呀?
- CreateProcess()还是ShellExecute()
- 如何竖排文本????
- 为什么会出现错误?一个比较复杂的问题,可能和多继承、泛型有关 -=100分=-
- 弱弱的问 偶不懂的说
- 请教!谢谢
- 懂安装Microsoft Visual Studio 7.0的高手请进
- C++怎么读文本内容包括换行符
- 显示位图,如何去掉闪索。
- 一个很急的问题,向大家们指教!
- unexpected end of file while looking for precompiled header directive 编译出错的提示,知道的请进来指点下!谢谢!
#ifndef _INSIDE_VISUAL_CPP_STUDENT
#define _INSIDE_VISUAL_CPP_STUDENTclass CStudent:public CObject
{
DECLARE_DYNAMIC(CStudent)
public:
CString m_strName;
int m_nGrade; CStudent()
{
m_nGrade=0;
}
CStudent(const char* szName,int nGrade):m_strName(szName)
{
m_nGrade=nGrade;
}
CStudent(const CStudent& s):m_strName(s.m_strName)
{
//copy constructor
m_nGrade=s.m_nGrade;
}
const CStudent& operator =(const CStudent& s)
{
m_strName=s.m_strName;
m_nGrade=s.m_nGrade;
return *this;
}
BOOL operator==(const CStudent& s)const
{
if ((m_strName==s.m_strName)&&(m_nGrade==s.m_nGrade)){
return TRUE;
}
else{
return FALSE;
} }
BOOL operator!=(const CStudent& s)const
{
return !(*this==s);
}
#ifdef _DEBUG
void Dump(CDumpContext& dc)const;
#endif//_DEBUG
};
#endif//_INSIDE_VISUAL_CPP_STUDENT#include "stdafx.h"#include "student.h"IMPLEMENT_DYNAMIC(CStudent,CObject)#ifdef _DEBUG
void CStudent::Dump(CDumpContext& dc)const
{
CObject::Dump(dc);
dc<<"m_strName="<<m_strName<<"\nm_nGrade="<<m_nGrade;
}
#endif//_DEBUG
这是头文件,但书中没有列出它的源代码文件。
要将student.h加入一个工程中,但引用时出错:没有文件student.h