一个关于全局theApp引用的问题
用mfc制作的多文档。代码如下 我在全局theApp声明了3个新变量(代码1)BYTE* m_HugeImage;int xsize;int ysize; 并且也给他们定义了(代码2),但是为什么我在引用的时候theApp-> 后面没有我新定义的三个变量啊,调了1天了 还是这样子,实在找不到头绪了,谢谢大家帮忙。。。
class CImgcxApp : public CWinApp //(代码一)
{
public:
CImgcxApp();
BYTE* m_HugeImage;
int xsize;
int ysize;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CImgcxApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CImgcxApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CImgcxApp::CImgcxApp() //代码二
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
xsize=::GetXSize();
ysize=::GetYSize();
BYTE *m_HugeImage=new BYTE[xsize*ysize*20];
}
[解决办法]
把这个CImgcxApp的头文件包含到你要用到那个文件中。
#include "CImgcxApp.h"
[解决办法]
语法错误啊 ,
双击错误提示, 看它指到哪一样代码啊,才好分析。
[解决办法]
->不显示你变量可能是IDE自己bug,不一定是代码错误,你还是照直使用即可,可以忽略这个错误
至于你列出的这些错误信息,似乎和你说的这个无法使用变量无关