resource.h student.cpp student.h

 
resource.h
// Student.h: interface for the CStudent class.
//
//

#if !defined(AFX_STUDENT_H__91A755BB_624D_4216_8D77_681DFC7FBEC3__INCLUDED_)
#define AFX_STUDENT_H__91A755BB_624D_4216_8D77_681DFC7FBEC3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CStudent  
{
private:
	CString name;
	int score;
public:
	CStudent();
	CStudent(const CString &n,const int s);
	void display(CDC *,int,int);
	virtual ~CStudent();

};


#endif // !defined(AFX_STUDENT_H__91A755BB_624D_4216_8D77_681DFC7FBEC3__INCLUDED_)

 

student.h


//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by My.rc
//
#define IDD_ABOUTBOX                    100
#define IDR_MAINFRAME                   128
#define IDR_MYTYPE                      129
#define IDD_DIALOG1                     130
#define IDC_EDIT1                       1000
#define IDC_EDIT2                       1002
#define IDC_EDIT3                       1003
#define ID_Menuitem32771                32771

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS                     1
#define _APS_NEXT_RESOURCE_VALUE        132
#define _APS_NEXT_COMMAND_VALUE         32772
#define _APS_NEXT_CONTROL_VALUE         1004
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif

 


 

// Student.cpp: implementation of the CStudent class.
//
//

#include "stdafx.h"
#include "My.h"
#include "Student.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//
// Construction/Destruction
//

CStudent::CStudent()
{

}
CStudent::CStudent(const CString &n, int s):name(n),score(s)
	{
	}

CStudent::~CStudent()
{

}
void CStudent::display(CDC *pDC,int x,int y)
{
	CString str;
	str.Format("姓名:%s  成绩:%d",name,score);
	pDC->TextOut(x,y,str);
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
出现"cannot open include file 'resource.h'"的错误通常是由于无法找到资源文件导致的。根据引用提到的解决方案,你可以尝试以下步骤来解决这个问题: 1. 打开Visual Studio Installer并点击修改。 2. 在单个组件,下载适用于最新v142生成工具的C MFC(x86和x64)组件,也可以考虑下载ATL组件(如果你之前没有下载的话)。 此外,根据引用引用[3]的内容,可能是由于项目的.h文件和.cpp文件实际上并不在同一个目录导致的。你可以检查一下在Visual Studio的项目设置,确保头文件和源文件的路径是正确的。 总结起来,解决"cannot open include file 'resource.h'"的问题的步骤如下: 1. 打开Visual Studio Installer并点击修改,下载适用于最新v142生成工具的C MFC(x86和x64)组件,确认是否需要下载ATL组件。 2. 检查项目设置,确保头文件和源文件的路径是正确的。 通过以上步骤,你应该能够解决该错误并成功引用resource.h文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决 fatal error RC1015:cannot open include file ‘afxres.h‘.](https://blog.csdn.net/weixin_42628111/article/details/128206063)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [C++ Visual Studio 2017 Error: Cannot open include file: .h: No such file or directory](https://blog.csdn.net/qazwsxrx/article/details/109097378)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值