// 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 该如何做?

解决方案 »

  1.   

    这样就可以
    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();
      

  2.   

    怎么可能呢。没发现有什么问题哦。
    Cxxx有没有包含page的头文件阿?
    不如发到[email protected]
      

  3.   

    刚才没细看代码,感觉楼主的做法也不应该有问题,不过
    最好改为
    CPageRegular(LPCTSTR strInfo);
    或者
    CPageRegular(const CString& strInfo);
      

  4.   

    我是想在一个自定义的属性页中显示一个数据表的属性,要把这个表的名称(strTable)传过去,可以不知道为什么这样构造却不行.