共享mfc库编译通过,但是静态编译报错 错误是 error C2039: “classCMyPropertyPage”: 不是“CMyPropertyPage”的成员可是我根本就没有这个叫做classCMyPropertyPage的东西。网上查的类似的,貌似是CMyPropertyPage不支持静态?那么要怎么改呢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在MyPropertyPage.h中加入DECLARE_DYNCREATE(CMyPropertyPage)在MyPropertyPage.cpp中加入IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage) DECLARE_DYNCREATE(CMyPropertyPage)IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)加入之后,报错error C2512: “CMyPropertyPage”: 没有合适的默认构造函数可用MyPropertyPage.h#pragma once#include "stdafx.h"class CMyPropertyPage : public CBCGPPropertyPage{ DECLARE_DYNCREATE(CMyPropertyPage)public: CMyPropertyPage(UINT nIDTemplate); virtual ~CMyPropertyPage(void);public: void SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId, CString m_tooltip); void SetListCtrlStyle(CListCtrl& m_ListCtrl);};MyPropertyPage.cpp#include "StdAfx.h"#include ".\mypropertypage.h"IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)CMyPropertyPage::CMyPropertyPage(UINT nIDTemplate) :CBCGPPropertyPage(nIDTemplate){}CMyPropertyPage::~CMyPropertyPage(void){}void CMyPropertyPage::SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId, CString m_tooltip){ //m_Button.m_bTransparent = TRUE; //m_Button.SetFaceColor(RGB(255,255,255)); m_Button.SetImage(uiBmpResId); m_Button.SetWindowText(_T("")); m_Button.SizeToContent(); m_Button.SetTooltip(m_tooltip);}void CMyPropertyPage::SetListCtrlStyle(CListCtrl& m_ListCtrl){ DWORD dwStyle = GetWindowLong(m_ListCtrl, GWL_STYLE); dwStyle &= ~(LVS_TYPEMASK); dwStyle &= ~(LVS_EDITLABELS); // Make sure we have report view and send edit label messages. SetWindowLong( m_ListCtrl, GWL_STYLE, dwStyle | LVS_REPORT|LVS_NOLABELWRAP|LVS_SHOWSELALWAYS); // Enable the full row selection and the drag drop of headers. DWORD styles = LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES; // Use macro since this is new and not in MFC. ListView_SetExtendedListViewStyleEx(m_ListCtrl, styles, styles );///宏} #pragma once#include "stdafx.h"class CMyPropertyPage : public CBCGPPropertyPage{ DECLARE_DYNCREATE(CMyPropertyPage) enum { IDD = IDD_MY_PAGE };public: CMyPropertyPage(UINT nIDTemplate=IDD); virtual ~CMyPropertyPage(void);public: void SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId, CString m_tooltip); void SetListCtrlStyle(CListCtrl& m_ListCtrl);};.cppIMPLEMENT_DYNCREATE(CMyPropertyPage, CBCGPPropertyPage) 不好意思,还有,这个 enum { IDD = IDD_MY_PAGE };指的是什么啊? 能详细说下DECLARE_DYNCREATE和DECLARE_DYNAMIC这2个宏的区别与应用么 MFC mdi子窗体背景色设置问题 我想做类似搜狐奥运新闻通知程序,或者gmail notify的程序,要了解那些知识啊? socket client 再次运行,与server连接不上(CPU100%) 以前学了一阵子java,现在想学vc,大家有什么好的建议? 问个非模式对话框的问题? WriteProcessMemory这个函数第二个参数怎么用的阿 有谁懂这些控件 菜鸟问题:lib库文件有什么作用? 对话框中的picture控件 高分救命:哪位大哥帮我写下线段与正方体的求交算法啊!! RS232串口发送数据问题 程序员炒股的人多吗?
DECLARE_DYNCREATE(CMyPropertyPage)在MyPropertyPage.cpp中加入
IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)
IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)
加入之后,报错error C2512: “CMyPropertyPage”: 没有合适的默认构造函数可用
MyPropertyPage.h#pragma once
#include "stdafx.h"
class CMyPropertyPage :
public CBCGPPropertyPage
{
DECLARE_DYNCREATE(CMyPropertyPage)public:
CMyPropertyPage(UINT nIDTemplate);
virtual ~CMyPropertyPage(void);public:
void SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId,
CString m_tooltip);
void SetListCtrlStyle(CListCtrl& m_ListCtrl);
};
MyPropertyPage.cpp#include "StdAfx.h"
#include ".\mypropertypage.h"
IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)CMyPropertyPage::CMyPropertyPage(UINT nIDTemplate)
:CBCGPPropertyPage(nIDTemplate)
{
}CMyPropertyPage::~CMyPropertyPage(void)
{
}void CMyPropertyPage::SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId,
CString m_tooltip)
{
//m_Button.m_bTransparent = TRUE;
//m_Button.SetFaceColor(RGB(255,255,255));
m_Button.SetImage(uiBmpResId);
m_Button.SetWindowText(_T(""));
m_Button.SizeToContent();
m_Button.SetTooltip(m_tooltip);}void CMyPropertyPage::SetListCtrlStyle(CListCtrl& m_ListCtrl)
{
DWORD dwStyle = GetWindowLong(m_ListCtrl, GWL_STYLE);
dwStyle &= ~(LVS_TYPEMASK);
dwStyle &= ~(LVS_EDITLABELS); // Make sure we have report view and send edit label messages.
SetWindowLong( m_ListCtrl, GWL_STYLE,
dwStyle | LVS_REPORT|LVS_NOLABELWRAP|LVS_SHOWSELALWAYS); // Enable the full row selection and the drag drop of headers.
DWORD styles = LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
// Use macro since this is new and not in MFC.
ListView_SetExtendedListViewStyleEx(m_ListCtrl, styles, styles );///宏
}
#include "stdafx.h"
class CMyPropertyPage :
public CBCGPPropertyPage
{
DECLARE_DYNCREATE(CMyPropertyPage)
enum { IDD = IDD_MY_PAGE };
public:
CMyPropertyPage(UINT nIDTemplate=IDD);
virtual ~CMyPropertyPage(void);public:
void SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId,
CString m_tooltip);
void SetListCtrlStyle(CListCtrl& m_ListCtrl);
};.cpp
IMPLEMENT_DYNCREATE(CMyPropertyPage, CBCGPPropertyPage)
指的是什么啊?
能详细说下DECLARE_DYNCREATE和DECLARE_DYNAMIC这2个宏的区别与应用么