Re: PutinnerHTML - Modifying HTML
It looks like that code works, but I can't tell you if it's the newest,
most fashionably cool way to do it. You might find more savvy people in
one of the newsgroups with "inetsdk.programming" or "web" or "html" in
their name.
As for free forums where coders hang out, have you seen CodeGuru and
CodeProject yet?
Paul wrote:
Hi,
First of all, are there popular free forums where a lot of coders
hangout? When out of debt I'll try the Experts Exchange.
Anyhow, it's been awhile since doing activeX webbrowser stuff, and was
wondering if the following code is the newest and/or best way of
modifying a web page using the webbrowser activeX control.
Code within DocumentComplete:
void CCformviewtestView::OnDocumentCompleteExplorer1(LPDISPATCH pDisp,
VARIANT FAR* URL)
{
MSHTML::IHTMLDocument2Ptr document = m_bwin.GetDocument();
MSHTML::IHTMLElementPtr body = document->Getbody();
_bstr_t bst = body->GetinnerHTML();
CString html((LPCWSTR) bst);
html.Replace("whatever html to be replaced", "new html");
body->PutinnerHTML(_bstr_t(html));
}
where m_bwin is a member variable to the CViewForm dialog.
Thanks for any help!
Paul