M
Mosfet
Hi,
let's say I have a class defined like that :
..H
class CViewMgr
{
public:
enum ECreationMode
{
CREATE_ONCE = 0,
CREATE_AND_DESTROY,
};
struct stViewInfo
{
UINT iViewId;
ECreationMode eCreationMode;
UINT iSysViewId;
CView* pView;
};
};
I would like to create an array of stViewInfo structure.
So I did this :
..CPP:
CViewMgr::stViewInfo g_ViewInfo[] =
{
{ IDD_TESTSWITCHVIEW_FORM, CViewMgr::CREATE_ONCE,
AFX_IDW_PANE_FIRST, NULL },
{ IDD_WELCOME_VIEW, CViewMgr::CREATE_AND_DESTROY,
AFX_IDW_PANE_FIRST + 1, NULL },
{ IDD_OTHER_VIEW, CViewMgr::CREATE_AND_DESTROY, AFX_IDW_PANE_FIRST +
2, NULL },
};
and it works but from what I understand my g_ViewInfo is global while I
would like to restrict its scope to CViewMgr.
How can I do this ?
I would like something like CViewMgr::stViewInfo CViewMgr::g_ViewInfo[]=...
let's say I have a class defined like that :
..H
class CViewMgr
{
public:
enum ECreationMode
{
CREATE_ONCE = 0,
CREATE_AND_DESTROY,
};
struct stViewInfo
{
UINT iViewId;
ECreationMode eCreationMode;
UINT iSysViewId;
CView* pView;
};
};
I would like to create an array of stViewInfo structure.
So I did this :
..CPP:
CViewMgr::stViewInfo g_ViewInfo[] =
{
{ IDD_TESTSWITCHVIEW_FORM, CViewMgr::CREATE_ONCE,
AFX_IDW_PANE_FIRST, NULL },
{ IDD_WELCOME_VIEW, CViewMgr::CREATE_AND_DESTROY,
AFX_IDW_PANE_FIRST + 1, NULL },
{ IDD_OTHER_VIEW, CViewMgr::CREATE_AND_DESTROY, AFX_IDW_PANE_FIRST +
2, NULL },
};
and it works but from what I understand my g_ViewInfo is global while I
would like to restrict its scope to CViewMgr.
How can I do this ?
I would like something like CViewMgr::stViewInfo CViewMgr::g_ViewInfo[]=...