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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IHTMLElementEvents event handling in CHtmlEditView

IHTMLElementEvents event handling in CHtmlEditView

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
5 Posts 2 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.
  • U Offline
    U Offline
    User 51754
    wrote on last edited by
    #1

    Does anyone know how to capture IHTMLElementEvent events (onclick) for CHtmlEditView? I've tried ON_EVENT and ON_EVENT_RELFECT - doesn't work. Need to capture events for DISPID_HTMLELEMENTEVENTS2_ONCLICK etc. Must I create a CCmdTarget sub? What and How do i do it. I'm desparately trying to complete my project - any help will be GREATLY appreciated :confused: Thanks Art

    C 1 Reply Last reply
    0
    • U User 51754

      Does anyone know how to capture IHTMLElementEvent events (onclick) for CHtmlEditView? I've tried ON_EVENT and ON_EVENT_RELFECT - doesn't work. Need to capture events for DISPID_HTMLELEMENTEVENTS2_ONCLICK etc. Must I create a CCmdTarget sub? What and How do i do it. I'm desparately trying to complete my project - any help will be GREATLY appreciated :confused: Thanks Art

      C Offline
      C Offline
      ColinDavies
      wrote on last edited by
      #2

      Does an IHTMLElementEvent Interface exist ? Maybe you should be using ... IHTMLEventObj which you can get to from the IHTMLDocument ? then use get_event ? Also if your element has an "ID" it would be easier to track. Regardz Colin J Davies

      Sonork ID 100.9197:Colin

      You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.

      U 1 Reply Last reply
      0
      • C ColinDavies

        Does an IHTMLElementEvent Interface exist ? Maybe you should be using ... IHTMLEventObj which you can get to from the IHTMLDocument ? then use get_event ? Also if your element has an "ID" it would be easier to track. Regardz Colin J Davies

        Sonork ID 100.9197:Colin

        You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.

        U Offline
        U Offline
        User 51754
        wrote on last edited by
        #3

        [ Actually IHTMLElementEvents ] All i need do is to capture the onclick ondblclick events for html elements (all have ids)on the CHtmlEditView. I've tried : DISP_FUNCTION_ID(CtestView, "onclick", DISPID_HTMLELEMENTEVENTS2_ONCLICK, OnElementClick, VT_BOOL, VTS_VARIANT) Doesn't work. Tried ON_EVENT etc. Nothing seems to capture the mouse click on the CHtmlEditView in design mode. Any ideas? Thanks Art

        C 2 Replies Last reply
        0
        • U User 51754

          [ Actually IHTMLElementEvents ] All i need do is to capture the onclick ondblclick events for html elements (all have ids)on the CHtmlEditView. I've tried : DISP_FUNCTION_ID(CtestView, "onclick", DISPID_HTMLELEMENTEVENTS2_ONCLICK, OnElementClick, VT_BOOL, VTS_VARIANT) Doesn't work. Tried ON_EVENT etc. Nothing seems to capture the mouse click on the CHtmlEditView in design mode. Any ideas? Thanks Art

          C Offline
          C Offline
          ColinDavies
          wrote on last edited by
          #4

          Art Cote wrote: [ Actually IHTMLElementEvents ] Ok that must be new also ? I'm a bit out of date with this. One ugly solution I have used is to monitor the ?? OnStatusTextChange ?? message. Can you build an app to monitor the events fired from your CHtmlEditView ? And then back track for it ? Regardz Colin J Davies

          Sonork ID 100.9197:Colin

          You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.

          1 Reply Last reply
          0
          • U User 51754

            [ Actually IHTMLElementEvents ] All i need do is to capture the onclick ondblclick events for html elements (all have ids)on the CHtmlEditView. I've tried : DISP_FUNCTION_ID(CtestView, "onclick", DISPID_HTMLELEMENTEVENTS2_ONCLICK, OnElementClick, VT_BOOL, VTS_VARIANT) Doesn't work. Tried ON_EVENT etc. Nothing seems to capture the mouse click on the CHtmlEditView in design mode. Any ideas? Thanks Art

            C Offline
            C Offline
            ColinDavies
            wrote on last edited by
            #5

            One thing you might be ommiting to do is EnableAutomation(); I'm guessing you would have to do this every time the elements were created. As in a constructor. This was needed for use with the DISPID_HTMLDOCUMENTEVENTS_ONCLICK, otherwise it wouldn't show up. Maybe one test you could try is sending a IHTMLElement::click() Command Or whatever it is you use with the EditView to see what message should be fired back out. Unfortunatly I don't have VC7 to play with so I'm not much help. :-( Regardz Colin J Davies

            Sonork ID 100.9197:Colin

            You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining. Said by Roger Wright about me.

            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