如何在vs 2008中使用cmfcpropertysheet [英] how to use cmfcpropertysheet in vs 2008

查看:212
本文介绍了如何在vs 2008中使用cmfcpropertysheet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中使用SetLook()方法

头文件是

 #pragma一次
 #include   " 
 #include   " 
  CLifePlanningSheet:公共 CPropertySheet
{
DECLARE_DYNAMIC(CLifePlanningSheet)
公共:
CLifePlanningSheet(UINT nIDCaption,CWnd * pParentWnd = NULL,UINT iSelectPage =  0 );
CLifePlanningSheet(LPCTSTR pszCaption,CWnd * pParentWnd = NULL,UINT iSelectPage =  0 );
CLifePlanningSheet();
// 虚拟〜CLifePlanningSheet(); 
私有:
CComputerScience pgeComputerScience;
    CInformationTechnology pgeInformationTechnology;

受保护的:
DECLARE_MESSAGE_MAP()
}; 


和vc ++文件是

 //  LifePlanningSheet.cpp:实施文件
//  

#include   "  stdafx.h"
 #include   " 
 #include   " 
 #include   <   cstdlib  > 
 IMPLEMENT_DYNAMIC(CLifePlanningSheet,CPropertySheet)
CLifePlanningSheet :: CLifePlanningSheet()
{
AddPage(&pgeComputerScience);
AddPage(& pgeInformationTechnology);
SetLook(CPropertySheet :: PropSheetLook_Tabs);
}
BEGIN_MESSAGE_MAP(CLifePlanningSheet,CPropertySheet)
END_MESSAGE_MAP()


运行程序时,它会出现以下错误
错误C3861:``SetLook'':找不到标识符
错误C2065:"PropSheetLook_Tabs":未声明的标识符
错误C2039:"PropSheetLook_Tabs":不是"CPropertySheet"的成员

解决方案

您的班级是从CPropertySheet派生的,而不是从CMFCPropertySheet派生的.

您必须在头文件和源文件中将所有出现的CPropertySheeet替换为CMFCPropertySheet.不是CPropertySheet的成员.顺便说一句,您不运行程序,只是在尝试对其进行编译,这些消息来自编译器,告诉您源代码中缺少某些内容.


SetLook()方法是vs2010,2012中不存在的CMFCPropertySheet类方法,而vs 2008中不存在


I want to use SetLook() method in my application

header file is

#pragma once
#include "ComputerScience.h"
#include "InformationTechnology.h"
class CLifePlanningSheet : public CPropertySheet
{
	DECLARE_DYNAMIC(CLifePlanningSheet)
public:
	CLifePlanningSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CLifePlanningSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CLifePlanningSheet();
	//virtual ~CLifePlanningSheet();
private:
	  CComputerScience		pgeComputerScience;
    CInformationTechnology	pgeInformationTechnology;

protected:
	DECLARE_MESSAGE_MAP()
};


and vc++ file is

// LifePlanningSheet.cpp : implementation file
//

#include "stdafx.h"
#include "LifePlanning.h"
#include "LifePlanningSheet.h"
#include <cstdlib>
IMPLEMENT_DYNAMIC(CLifePlanningSheet, CPropertySheet)
CLifePlanningSheet::CLifePlanningSheet()
{
	AddPage(&pgeComputerScience);
	AddPage(&pgeInformationTechnology);
	SetLook(CPropertySheet::PropSheetLook_Tabs);
}
BEGIN_MESSAGE_MAP(CLifePlanningSheet, CPropertySheet)
END_MESSAGE_MAP()


When run the program it gives following errors
error C3861: ''SetLook'': identifier not found
error C2065: ''PropSheetLook_Tabs'' : undeclared identifier
error C2039: ''PropSheetLook_Tabs'' : is not a member of ''CPropertySheet''

how to remove that?

解决方案

You class is derived from CPropertySheet, not from CMFCPropertySheet.

You must replace all occurences of CPropertySheeet by CMFCPropertySheet in your header and source files.


You are referring to a member function which you have not declared, and a data member which is not a member of CPropertySheet. By the way you are not running the program, you are merely trying to compile it, these messages are from the compiler telling you that you have things missing from your source code.


SetLook()method is a CMFCPropertySheet class method which is in vs2010,2012 not present in vs 2008


这篇关于如何在vs 2008中使用cmfcpropertysheet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆