引入头文件ClientDlg.h的两种情况如下:
1)
#include "stdafx.h"
#include "Client.h"
#include "ClientSocket.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "ClientDlg.h"
2)
#include "ClientDlg.h"
#include "stdafx.h"
#include "Client.h"
#include "ClientSocket.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
然后使用CClientDlg ccliengDlg;第二种情况出现错误,说没有定义。原因是引用顺序不一样。比如B.h引用到在A.h中定义的宏,但是include的时候把B.h放在A.h前就会出错