我已经把DownloadCompleteExplorer2弄出来了,可是在这里刷新后页面始终不变了,跟在nagivate后面加这个语句效果一样 我把我的代码贴出来 大家看看BOOL Ctestwebbrowser2Dlg::OnInitDialog() { CDialog::OnInitDialog(); m_iNeedFresh = 0; // Set the icon for this dialog. The framework does this automatically SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon m_iMyIE.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,800,400),this,IDC_EXPLORER2);
return TRUE; // return TRUE unless you set the focus to a control } void Ctestwebbrowser2Dlg::OnBnClickedButton2() { // TODO: Add your control notification handler code here m_iNeedFresh=1; m_iMyIE.Navigate(_T("\\NandFlash\\1.html"),NULL,NULL,NULL,NULL); }void Ctestwebbrowser2Dlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here m_iNeedFresh =1; m_iMyIE.Navigate(_T("\\NandFlash\\2.html"),NULL,NULL,NULL,NULL); }
void Ctestwebbrowser2Dlg::DownloadCompleteExplorer2() { // TODO: Add your message handler code if (m_iNeedFresh>0) { m_iNeedFresh = 0; m_iMyIE.Refresh(); } }
这是我做的webbrowser,加载速度很快,代码也很清晰,对你这个问题有帮助!!
代码是挺好,不过不是我想要的,win32下我也做了个例子,一点问题都没有的....还有我要加载的是本地文档
我把我的代码贴出来 大家看看BOOL Ctestwebbrowser2Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_iNeedFresh = 0;
// Set the icon for this dialog. The framework does this automatically
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_iMyIE.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,800,400),this,IDC_EXPLORER2);
return TRUE; // return TRUE unless you set the focus to a control
}
void Ctestwebbrowser2Dlg::OnBnClickedButton2()
{
// TODO: Add your control notification handler code here
m_iNeedFresh=1;
m_iMyIE.Navigate(_T("\\NandFlash\\1.html"),NULL,NULL,NULL,NULL);
}void Ctestwebbrowser2Dlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
m_iNeedFresh =1;
m_iMyIE.Navigate(_T("\\NandFlash\\2.html"),NULL,NULL,NULL,NULL);
}
void Ctestwebbrowser2Dlg::DownloadCompleteExplorer2()
{
// TODO: Add your message handler code
if (m_iNeedFresh>0)
{
m_iNeedFresh = 0;
m_iMyIE.Refresh();
}
}
BringWindowToTop试一下,看能不能迫使它重画
BringWindowToTop试一下,看能不能迫使它重画
BringWindowToTop试一下,看能不能迫使它重画
还有一个方法就是在nagivate一次,手动点击按钮可以.我在定时器中1s在加载一次就能解决这个问题.
但是这样毕竟不好,不知道是什么原因,求达人相助啊~