class CMechanism : public CDialog
{
// Construction
public:
CMechanism(CWnd* pParent = NULL);   // standard constructor void cd_analyze_data(void);
void cd_update_media_info();
UCHAR cd_check_sum_valid(UCHAR *Data, UCHAR rev_length);
LONG  On_rev_i2c_data(UCHAR  rev_number_of_frame, UINT end_number);
void  mechanism_init();
BOOL InitMech(CWnd* pPortOwner);
CI2cTrace   *pI2cTrace_m; 
CLCDDlg    *Pclcdlg; // 加上这一句就出了下面的error }问一下, 下面的error 怎么回事了. 我已包含了LCDDlg 类的头文件.d:\lcd1\lcd1\mechanism1.h(196) : error C2143: syntax error : missing ';' before '*'
d:\lcd1\lcd1\mechanism1.h(196) : error C2501: 'CLCDDlg' : missing storage-class or type specifiers
d:\lcd1\lcd1\mechanism1.h(196) : error C2501: 'Pclcdlg' : missing storage-class or type specifiers[/color][/color]class CLCDDlg : public CDialog
{
// Construction
public: CLCDDlg(CWnd* pParent = NULL); // standard constructor
CListCtrl*  m_nlistLSDHDJ;
// Dialog Data
//{{AFX_DATA(CLCDDlg)
enum { IDD = IDD_LCD_DIALOG };
CKeyBoard m_numkeyboard;
CKeyBoard m_funkeyboard;
CMatrixStatic m_LCD;
CString m_funstr;
CString m_numcallbackedit;
//}}AFX_DATA // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLCDDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected:
DWORD TimerID_Start; //计时器标号
DWORD TimerID_UpdateData; //计时器标号
DWORD TimerID_MidifyTime; //计时器标号protected:
BOOL m_bFirst; //first time call
CObList m_wndList;
   
protected:
int nPort;
int nBaud;
CSerialPort *m_pPort;
CI2cTrace   *pI2cTrace; 
 CMechanism  *pmech; unsigned char m_strReceived[N];
int index;
bool bOpen;
private:
  CImageList m_image;
  int m_cxImage, m_cyImage;
 public:
CWnd* m_pParent;
CTreeCtrl m_TreeCtrl;
HTREEITEM hItem;
HTREEITEM hRoot;
CImageList m_imageList;
}

解决方案 »

  1.   

    要么在class CMechanism前面包含#include "LCDDlg.h",要么在class CMechanism前面前置声明class CLCDDlg;在Mechanism.cpp中#include "LCDDlg.h"。
      

  2.   

    我已经在class CMechanism前面包含#include "LCDDlg.h",但没用呀
      

  3.   

    在CMechanism的CPP文件中加入#include "LCDDlg.h",编译时还是会出错,不用管,在点连接就OK了。。