用mfc生成的应用程序框架,用的chtmlview类;
想在在cmainframe类中调用chtmlview类的Navigate2函数
如下:
CMyView* m_pView=(CMyView*)GetActiveView();
m_pView->Navigate2(m_pView->GetURL(m_pView->m_Url),NULL,NULL
为什么在MainFrm.cpp文件中加入#include "MyView"会出现错误:
syntax error : missing ';' before '*'
error C2501: 'CUClientDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers这是什么错误?怎样解决?实现访问Navigate2还有别的方法么?
谢谢!
想在在cmainframe类中调用chtmlview类的Navigate2函数
如下:
CMyView* m_pView=(CMyView*)GetActiveView();
m_pView->Navigate2(m_pView->GetURL(m_pView->m_Url),NULL,NULL
为什么在MainFrm.cpp文件中加入#include "MyView"会出现错误:
syntax error : missing ';' before '*'
error C2501: 'CUClientDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers这是什么错误?怎样解决?实现访问Navigate2还有别的方法么?
谢谢!
#include "MyView.h"and use your function
while(pos!=NULL)
{
CView *pView=GetNextView(pos);
//在此判断该View是否为你需要的,是则pView->Navigate2(...);}
POSITION pos = pDoc->GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = pDoc->GetNextView(pos); if(pView->GetRuntimeClass() == RUNTIME_CLASS(CScreenView)) {
SetActiveView(pView);
break;
}
}
class MyView;