我自己编了一个没有文档视图结构的打印程序,可是在编译时报错
 pFrame->Create(NULL,"Curve Print Preview",WS_OVERLAPPEDWINDOW,CRect(0,0,0,0));error C2660: 'Create' : function does not take 4 parameters
请高手指点一下,错在哪了

解决方案 »

  1.   

    显然你的Create函数里面传递的参数个数不是4个
      

  2.   

    pFrame指针是什么类型,怎样定义的
      

  3.   

    class CPrintFrame : public CView
    {
    public:
    CPrintFrame();           // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CPrintFrame)// Attributes
    public:
        CPrintView *m_pView;
    CDialog *m_pCallerDlg;
    CWnd *m_pWnd;
    // Operations
    public:// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CPrintFrame)
    protected:
    virtual void OnDraw(CDC* pDC);      // overridden to draw this view protected:
    virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);

    //}}AFX_VIRTUAL// Implementation
    protected:
    virtual ~CPrintFrame();
    #ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
    #endif // Generated message map functions
    public:
    //{{AFX_MSG(CPrintFrame)
    afx_msg void OnDestroy();
    // NOTE - the ClassWizard will add and remove member functions here.
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };
      

  4.   

    LZ是以CVIEW为基类,create函数自然不能用CMainFrame的方式来写
    因为CView下的create为
             virtual BOOL Create(LPCTSTR lpszClassName,
    LPCTSTR lpszWindowName, 
                    DWORD dwStyle,
    const RECT& rect,
    CWnd* pParentWnd, UINT nID,
    CCreateContext* pContext = NULL);
      

  5.   

    可以看看Create函数到底有多少个参数。一个一个的传递。
      

  6.   

    virtual BOOL Create(
       LPCTSTR lpszClassName,
       LPCTSTR lpszWindowName,
       DWORD dwStyle,
       Const RECT& rect,
       CWnd* pParentWnd,
       UINT nID,
       CCreateContext* pContext = NULL
    );