Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CHtmlEditCtrl Control Creation Failed

CHtmlEditCtrl Control Creation Failed

Scheduled Pinned Locked Moved C / C++ / MFC
helphtmlcomarchitecturequestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi! I'm looking for creating a program in which I would like to add a dialog which contains a Html Edit Control like the one we can get by using the Document/View architecture with the CHtmlEditDoc class as the Document Class. Here a portion of my code: BOOL CHTMLCDlg::OnInitDialog() { CDialog::OnInitDialog(); CHtmlEditCtrl m_HtmlEdit; m_HtmlEdit.Create ("",0, CRect (0,0,100,100), this, 1); .... I get the following error: error C2248: 'CHtmlEditCtrl::~CHtmlEditCtrl' : cannot access protected member declared in class 'CHtmlEditCtrl' Does anyone could help me? Thks in advance! Appstmd http://www.appstmd.com

    J 1 Reply Last reply
    0
    • L Lost User

      Hi! I'm looking for creating a program in which I would like to add a dialog which contains a Html Edit Control like the one we can get by using the Document/View architecture with the CHtmlEditDoc class as the Document Class. Here a portion of my code: BOOL CHTMLCDlg::OnInitDialog() { CDialog::OnInitDialog(); CHtmlEditCtrl m_HtmlEdit; m_HtmlEdit.Create ("",0, CRect (0,0,100,100), this, 1); .... I get the following error: error C2248: 'CHtmlEditCtrl::~CHtmlEditCtrl' : cannot access protected member declared in class 'CHtmlEditCtrl' Does anyone could help me? Thks in advance! Appstmd http://www.appstmd.com

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Ummm. It's strange that the dtor is protected, but nevertheless you're doing it wrong, since in this case the control should be dynamically allocated:

      BOOL CHTMLCDlg::OnInitDialog()
      {
      CDialog::OnInitDialog();
       
      CHtmlEditCtrl* m_HtmlEdit=new CHtmlEditCtrl();
      m_HtmlEdit->Create ("",0, CRect (0,0,100,100), this, 1);
      ....

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      R L 2 Replies Last reply
      0
      • J Joaquin M Lopez Munoz

        Ummm. It's strange that the dtor is protected, but nevertheless you're doing it wrong, since in this case the control should be dynamically allocated:

        BOOL CHTMLCDlg::OnInitDialog()
        {
        CDialog::OnInitDialog();
         
        CHtmlEditCtrl* m_HtmlEdit=new CHtmlEditCtrl();
        m_HtmlEdit->Create ("",0, CRect (0,0,100,100), this, 1);
        ....

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        R Offline
        R Offline
        rjuncu
        wrote on last edited by
        #3

        I don't know about your CHtmlEditCtrl (???) but I've tried this with CHtmlView and it works very nice. CHtmlView (like all CView's has the constructor protected) //in your OnInitDialog CHtmlView *pView ; CRuntimeClass *pRtClass = RUNTIME_CLASS(CHtmlView); pView = (CHtmlView *) pRtClass->CreateObject(); pView->Create(NULL, NULL, WS_VISIBLE | WS_CHILD, rct, this, IDC_STATIC_CTRL); pView->Navigate2(_T("www.microsoft.com")); Romeo JUNCU

        1 Reply Last reply
        0
        • J Joaquin M Lopez Munoz

          Ummm. It's strange that the dtor is protected, but nevertheless you're doing it wrong, since in this case the control should be dynamically allocated:

          BOOL CHTMLCDlg::OnInitDialog()
          {
          CDialog::OnInitDialog();
           
          CHtmlEditCtrl* m_HtmlEdit=new CHtmlEditCtrl();
          m_HtmlEdit->Create ("",0, CRect (0,0,100,100), this, 1);
          ....

          Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Thks, the code is working now. :) Thks in advance! Appstmd http://www.appstmd.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups