Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Subscribe to HTMLInputTextElementEvents??? [modified]

Subscribe to HTMLInputTextElementEvents??? [modified]

Scheduled Pinned Locked Moved COM
question
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Romiks
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • R Romiks

      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

      R Offline
      R Offline
      Romiks
      wrote on last edited by
      #2

      Thanks, I found the error.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups