// pageregular.h
//...
class CPageRegular : public CPropertyPage
{
DECLARE_DYNCREATE(CPageRegular)// Construction
public:
CPageRegular(CString strInfo); // !!
CString m_strInfo; // !!
//...// pageregular.cpp
CPageRegular::CPageRegular(CString strInfo) : CPropertyPage(CPageRegular::IDD)
{
//{{AFX_DATA_INIT(CPageRegular)
//}}AFX_DATA_INIT
m_strInfo = strInfo;
}
// call.cppvoid Cxxx:OnProperty()
{
CPageRegular page1("D:\\abc.cpp"); // 编译指出找不到相关的构造函数? CPropertySheet sheet("属性");
sheet.AddPage(&page1); sheet.DoModal();}
如果用 m_psp.lParam 该如何做?
//...
class CPageRegular : public CPropertyPage
{
DECLARE_DYNCREATE(CPageRegular)// Construction
public:
CPageRegular(CString strInfo); // !!
CString m_strInfo; // !!
//...// pageregular.cpp
CPageRegular::CPageRegular(CString strInfo) : CPropertyPage(CPageRegular::IDD)
{
//{{AFX_DATA_INIT(CPageRegular)
//}}AFX_DATA_INIT
m_strInfo = strInfo;
}
// call.cppvoid Cxxx:OnProperty()
{
CPageRegular page1("D:\\abc.cpp"); // 编译指出找不到相关的构造函数? CPropertySheet sheet("属性");
sheet.AddPage(&page1); sheet.DoModal();}
如果用 m_psp.lParam 该如何做?
CHAR* pStr = new CHAR[255];
strcpy(pStr, ("D:\\abc.cpp");
CPageRegular page1;
page1.m_psp.lParam = (LPARAM)pStr;
CPropertySheet sheet("属性");
sheet.AddPage(&page1); sheet.DoModal();
Cxxx有没有包含page的头文件阿?
不如发到[email protected]
最好改为
CPageRegular(LPCTSTR strInfo);
或者
CPageRegular(const CString& strInfo);