#define WM_DISPLAY WM_USER + 100试一下吧

解决方案 »

  1.   

    to michaelrunsonc():
    换成#define WM_DISPLAY WM_USER + 100
    后,现在变成了这个错:
    d:\..\.h(19) : error C2504: 'CDialog' : base class undefined
    下面是整个.h
    #if !defined(AFX_SHOWINFO_H__A14D0F26_0F5F_11D6_8339_00E04C501B07__INCLUDED_)
    #define AFX_SHOWINFO_H__A14D0F26_0F5F_11D6_8339_00E04C501B07__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    // ShowInfo.h : header file
    ///////////////////////////////////////////////////////////////////////////////
    // CShowInfo dialogconst WM_DISPLAY=WM_USER + 100;//#define WM_DISPLAY  WM_USER + 100;
    class CShowInfo : public CDialog
    {
    // Construction
    public:
    CShowInfo(CWnd* pParent = NULL);   // standard constructor// Dialog Data
    //{{AFX_DATA(CShowInfo)
    enum { IDD = IDD_SHOWINFODLG };
    // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CShowInfo)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected: // Generated message map functions
    //{{AFX_MSG(CShowInfo)
    // 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_SHOWINFO_H__A14D0F26_0F5F_11D6_8339_00E04C501B07__INCLUDED_)
      

  2.   

    你肯定是windows.h没挂进去
    检查一下有没有include “stdafx.h"吧
      

  3.   

    最好是用:
      #define WM_DISPLAY  (WM_USER + 100)
      

  4.   

    肯定是stdafx.h的毛病,选择build菜单,然后clean,然后重新build,就可以了。
    define后没有分号
      

  5.   

    我有另外一个cpp包含了这个.h  但那个cpp没有包含StdAfx.h,我现在在那个cpp中把
    StdAfx.h包含进去了,好是好了,但是why?
      

  6.   

    WM_USER在windows.h中定义
    而windows.h在stdafx.h中include
    你不include stdafx.h当然是WM——USE没定义了