Cory C. Albrecht wrote:

void CHtmlWindow::ClearBody()
{
    phtml = GetDocument();
    if (phtml != NULL) {
                phtml->Release();
    }
}

hr = pbody->insertAdjacentHTML(_bstr_t("beforeEnd"), line);

First off, why would IHTMLDocument2::get_body() crash after after using the code in ClearBody()?

Does GetDocument() addref? Because you're releasing its return value... I notice you're not releasing the return value of get_body; what does GetDocument() do exactly?


Note that if the get_body() call in AddLine() is what's crashing, the problem is more likely with the value of phtml there than with the body itself.

Second, why would IHTMLDocument2::insertAdjacentHTML() fail to add the new HTML? Anybody have nay ideas?

Mozilla does not implement IE's adjacentHTML methods, so insertAdjacentHTML returns E_NOTIMPL.


-Boris
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to