Re: CHtmlEditCtrl SetDocumentHtml() Problem
On Oct 9, 12:23 pm, spinybabler <spineybabb...@gmail.com> wrote:
Hi,
I was trying to use CHtmlEditCtrl for editing but for some reasons
SetDocumentHtml() is not working. I have a dialog where I dynamically
create this control and try to set the document html where
SetDocumentHtml() comes into play and doesn't seem to work.I googled
for solutions and found that the document is not ready for editing
until DocumentComplete event is fired. But I couldn't find such event.
I would appreciate help.
Also is it a good idea to use this control? I was looking for simple
solution and thought this control would be easy to use.
Thanks
I also ran into such problems sometime back. You can check whether
document load has completed or not using the code below
CComPtr<IHTMLDocument2> document;
BSTR ready;
m_htmlEdtCtrl.GetDocument(&document);
document->get_readyState(&ready);
if( ready == "complete")
{
//do sth
}
And also don't try to set the document in InitDialog() where you
might have created the control. Set it after InitDialog() is done.
Thanks