Try Applying this code within your
Invoke()
method. Then, you'll be capable of catching all the events within the
DIID_HTMLDocumentEvents2
Interface that are raised by your document. One of these events would be the
onPropertyChange
event which is raised everytime your document gets updated.
webBrowser->get_Document(&idisp);
idisp->QueryInterface(IID_IHTMLDocument2, (void**)&doc2);
IConnectionPointContainer *cpc=0;
if (doc2) doc2->QueryInterface(IID_IConnectionPointContainer, (void**) &cpc);
IConnectionPoint* cp=0;
if (cpc) cpc->FindConnectionPoint(DIID_HTMLDocumentEvents2, &cp);
if (cp) hr=cp->Advise(static_cast<idispatch*>(this), &cookie);
if (cp) cp->Release();
if (cpc) cpc->Release();
if (!doc2 )
{release(); return E_FAIL;}