MFC调用函数出错,望指教
新建一个MFC(exe)工程,工程名aaaa.h
class CAaApp : public CWinApp
{
public:
CAaApp();
virtual ~CAaApp();
public:
void abc();
}
aa.c
CAaApp::CAaApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
CAaApp::~CAaApp()
{
//释放内存申请资源
....................
}
BOOL CAaApp::InitInstance()
{
.............................
..................................
............................
abc();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
Void CCtemp::abc()
{
………………
}
如上,编译执行aa.c 一切正常,可是我在aaView.c中调用abc函数的时候却出现问题
aaView.c
#include "aa.h"
CAaApp temp; //全局变量
void CAaView::bb()
{
temp.abc();
}
aaView.h
class CAaView : public CView
{
protected: // create from serialization only
CAaView();
DECLARE_DYNCREATE(CAaView)
// Attributes
public:
CAaDoc* GetDocument();
void bb();
........................
}
如上,编译通过,可是执行却会报错(报错截图见附件)小弟是新手,还请各位多多指教