建立工程GetAirReport 对话框 工程,外部引入文件 FluxStatic.h FluxStatic.cpp 文件。 我想在新引入的类中 调用我的主对话框类GetAirReportDlg,  在 FluxStatic.cpp 中#include GetAirReportDlg.h
文件 结果出现以下错误, 可能跟在生成对话框类后又去改动IDD的名称 所致 。请高手解决 来看看。 解决了我要 一定重谢!   赏 你个 大耳光  哈哈
错误现象1 :
E:\vc6.0\MFC\GetAirReport\FluxStatic.cpp(9) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
e:\vc6.0\mfc\getairreport\showdlg.h(21) : error C2065: 'IDD_SHOWDLG' : undeclared identifier
e:\vc6.0\mfc\getairreport\showdlg.h(21) : error C2057: expected constant expression
e:\vc6.0\mfc\getairreport\getairreportdlg.h(22) : error C2065: 'IDD_GETAIRREPORT_DIALOG' : undeclared identifier
e:\vc6.0\mfc\getairreport\getairreportdlg.h(22) : error C2057: expected constant expression
Error executing cl.exe.在此文件中加入#include"resource.h" 文件 错误消失 ,但是 定义 GetAirReportDlg 对象就会出错。 CGetAirReportDlg dlg;  错误现象 2:
编译无错误 但是链接出错 弹出对话框
Debug Assertion Failed!
File:afxwin1.inl Line:
22
断点追踪到_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);}代码如下
#include <afx.h>
#include "FluxStatic.h"
#include "MemDC.h"a
#include <math.h>
//#include "resource.h" // 不加句就会出现 如上的  错误现象1
#include "ShowDlg.h" // 子对话框
#include "GetAirReportDlg.h" // 我的主对话框
 
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif CGetAirReportDlg dlg;   // 在这里加一句话就会出错现象2
 //ASSERT( *dlg==NULL);
  
/////////////////////////////////////////////////////////////////////////////
// CFluxStaticCFluxStatic::CFluxStatic()
{
brushInitalized = false;
// interfaceCallBack = NULL;
useAdaptiveScale = false;
gridxstartpos = 0;
gridystartpos = 0;
gridx = 15;       //在x方向的网格距离
gridy = 15;       //在y方向的网格距离
gridxspeed = -1;  //在x方向的网格滚动条的滚动速度
gridyspeed = 0;   //在y方向的网格滚动条的滚动速度
plot = 3;         //图中的曲线的宽度
netupdate = 1000; //数据定时器的更新速率
gridupdate = 50;  //网格更新速率
}CFluxStatic::~CFluxStatic()
{
}
BEGIN_MESSAGE_MAP(CFluxStatic, CStatic)
//{{AFX_MSG_MAP(CFluxStatic)
ON_WM_PAINT()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CFluxStatic message handlers
以下省去 。