CHtmlEditCtrl Control Creation Failed
-
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
-
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
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
-
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
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
-
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
Thks, the code is working now. :) Thks in advance! Appstmd http://www.appstmd.com