我在TMainFrame.h
中定义了一个wxObjArray,如下所示:
#ifndef __TMainFrame__
#define __TMainFrame__
#include "MyApp_gui.h"
//// end generated include
#include "TRunThread.h"
#include <wx/dynarray.h>
class TMove;
WX_DECLARE_OBJARRAY(TMove, TMoveArray);
/* ...Class TMainFrame... */
/* ...Class TMove... */
#endif // __TMainFrame__
现在我想在我的TRunThread.h
中使用由WX_DECLARE_OBJARRAY创建的类TMoveArray。
但无法找到该类(GCC:'TMoveArray'尚未声明)
#ifndef TRUNTHREAD_H_INCLUDED
#define TRUNTHREAD_H_INCLUDED
#include <wx/wx.h>
#include "TMainFrame.h"
// doesn't work: WX_DECLARE_OBJARRAY(TMove, TMoveArray);
class TRunThread : public wxThread
{
public:
wxThreadError Create(TMoveArray moves);
};
#endif // TRUNTHREAD_H_INCLUDED
源文件TRunThread.cpp
:
#include <wx/arrimpl.cpp> // this is a magic incantation which must be done!
WX_DEFINE_OBJARRAY(TMoveArray);
#include "TRunThread.h"
/* ...Code... */
我也试过了WX_DEFINE_OBJARRAY
指令。
问题:如何正确包含wxObjArray?
答案 0 :(得分:1)