Subscribe to HTMLInputTextElementEvents??? [modified]
-
Hi all, I am trying to subscribe for events like this:
CComPtr<IDispatch> spDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&spDisp);
if (SUCCEEDED(hr) && spDisp)
{
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML(spDisp);
if (spHTML)
{
CComQIPtr<IHTMLElement, &IID_IHTMLElement> spElem;
hr=spHTML->get_body(&spElem);
if (SUCCEEDED(hr))
{
IConnectionPointContainer* pCPC = NULL;
hr = spElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
IConnectionPoint* pCP = NULL;
hr = pCPC->FindConnectionPoint(DIID_HTMLInputTextElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
....
}
}
}
}
}FindConnectionPoint fails. Please show me where I am wrong or how else I can subscribe? :(
modified on Monday, August 4, 2008 7:38 AM
-
Hi all, I am trying to subscribe for events like this:
CComPtr<IDispatch> spDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&spDisp);
if (SUCCEEDED(hr) && spDisp)
{
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML(spDisp);
if (spHTML)
{
CComQIPtr<IHTMLElement, &IID_IHTMLElement> spElem;
hr=spHTML->get_body(&spElem);
if (SUCCEEDED(hr))
{
IConnectionPointContainer* pCPC = NULL;
hr = spElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
IConnectionPoint* pCP = NULL;
hr = pCPC->FindConnectionPoint(DIID_HTMLInputTextElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
....
}
}
}
}
}FindConnectionPoint fails. Please show me where I am wrong or how else I can subscribe? :(
modified on Monday, August 4, 2008 7:38 AM