CHtmlView可以浏览,不能编辑
CHtmlEditView只可以编辑
如何做到在编辑和浏览两种状态下切换??初学,不知以上表达对不对,还望指教一二。

解决方案 »

  1.   

    anyone to help me?
     
    3x!!
      

  2.   

    void CXXXHtmlView::SetDesignMode(BOOL bDesignMode)
    {
    BSTR bs = SysAllocString(bDesignMode?L"On":L"Off");
    if (m_pHtmlDoc != (IHTMLDocument2 *) NULL)
        m_pHtmlDoc->put_designMode(bs);
    SysFreeString(bs);
    }试试这个,vc6的chtmlview
      

  3.   

    你可以制作一个HTML的文件抓取函数:
    //httpName是网页
    //SavePath是存成文件的路径
    BOOL NetPage::DownloadPage(CString httpName, CString SavePath)
    {
    CInternetSession session;
    CInternetFile* file = NULL;
    try
    {
    // 试着连接到指定URL
    file = (CInternetFile*) session.OpenURL(httpName); 
    }
    catch (CInternetException* m_pException)
    {
    // 如果有错误的话,置文件为空
    file = NULL; 
    m_pException->Delete();
    return FALSE;
    } // 用dataStore来保存读取的网页文件
    CStdioFile dataStore; if (file)
    {
    CString  somecode; //也可采用LPTSTR类型,将不会删除文本中的\n回车符 BOOL bIsOk = dataStore.Open(SavePath,
    CFile::modeCreate 
    | CFile::modeWrite 
    | CFile::shareDenyWrite 
    | CFile::typeText);

    if (!bIsOk)
    return FALSE;
    // 读写网页文件,直到为空

    while (file->ReadString(somecode) != NULL) //如果采用LPTSTR类型,读取最大个数nMax置0,使它遇空字符时结束
    {
    dataStore.WriteString(somecode);
    dataStore.WriteString("\n");    //如果somecode采用LPTSTR类型,可不用此句
    }

    file->Close();
    delete file;
     }
     else
     {
    dataStore.WriteString(_T("Save Failed..."));
    return FALSE;
     }  return TRUE;
    }
      

  4.   

    补充,别忘#include "afxinet.h"