Hi,
is there a better way of getting CMyView pointer on object created using RUNTIME_CLASS than the one in code snippet?
I would like to get the pointer pointing on CMyView object right after RUNTIME_CLASS call locally and not to use global variable.
//global variable
CMyView* g_pView;
/////////////////////////////////////////
//dynamic creation of CView derived class somewhere else
RUNTIME_CLASS(CMyView);
/////////////////////////////////////////
//CMyView constructor
CMyView::CMyView()
{
g_pView = this;
}
Open in new window
CMyView* pView = (CMyView*)GetActiveView();
if(pView->IsKindOf(RUNTIME
http://msdn.microsoft.com/en-us/library/zs0t7t34(VS.80).aspx