最近学习时,找了一些现成的源代码,想给它添加一个新的对话框,我的步骤是这样的,先在资源里加了一个对话框,然后用CLASSWIZARD为它建了一个类,编译却不通过,出现下面的错误:
error C2065: 'IDD_SMS' : undeclared identifier
不知是何故,请高手指点!!!分不多,但绝对给。

解决方案 »

  1.   

    IDD_SMS是自定义的资源ID号.具体要看源代码.不能说代表什么.
      

  2.   

    #if !defined(AFX_SMS_H__994E6A85_D6EE_4813_9599_87166FC60E7E__INCLUDED_)
    #define AFX_SMS_H__994E6A85_D6EE_4813_9599_87166FC60E7E__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    // Sms.h : header file
    ///////////////////////////////////////////////////////////////////////////////
    // CSms dialogclass CSms : public CDialog
    {
    // Construction
    public:
    CSms(CWnd* pParent = NULL);   // standard constructor// Dialog Data
    //{{AFX_DATA(CSms)
    enum { IDD = IDD_SMS };
    // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CSms)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected: // Generated message map functions
    //{{AFX_MSG(CSms)
    // NOTE: the ClassWizard will add member functions here
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };//{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_SMS_H__994E6A85_D6EE_4813_9599_87166FC60E7E__INCLUDED_)
      

  3.   

    知道问题了,是没有包含#include "resource.h",麻烦大家了