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. ATL / WTL / STL
  4. Very Urgent:Overriding Idispatch Invoke

Very Urgent:Overriding Idispatch Invoke

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++javascript
2 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.
  • R Offline
    R Offline
    rana74
    wrote on last edited by
    #1

    We have an ATL object with dual interface type.The interface definition fron the IDL file: interface IEventSink : IDispatch{ [id(1), helpstring("method testmethod")] HRESULT testmethod(void); [propput, id(2), helpstring("property ondataavailable")] HRESULT ondataavailable([in] IDispatch* newVal); }; We invoke the object from javascript as follows: var esink=new ActiveXObject("IEBrowserSink.EventSink"); esink.testmethod(); esink.ondataavailable=invokecallback; It works fine; Now i oveeride the Invoke method in the header file: STDMETHOD(Invoke)(DISPID dispidMember,REFIID riid, LCID lcid, WORD wFlags,DISPPARAMS * pdispparams, VARIANT * pvarResult,EXCEPINFO * pexcepinfo, UINT * puArgErr) { ...... return S_OK; } After this the calls to the 'testmethod' and 'ondataavilable' from javascript do not go through? There are no exceptions but the scripts seems to skip these methods.What is wrong? Are any changes requied in the idl?

    P 1 Reply Last reply
    0
    • R rana74

      We have an ATL object with dual interface type.The interface definition fron the IDL file: interface IEventSink : IDispatch{ [id(1), helpstring("method testmethod")] HRESULT testmethod(void); [propput, id(2), helpstring("property ondataavailable")] HRESULT ondataavailable([in] IDispatch* newVal); }; We invoke the object from javascript as follows: var esink=new ActiveXObject("IEBrowserSink.EventSink"); esink.testmethod(); esink.ondataavailable=invokecallback; It works fine; Now i oveeride the Invoke method in the header file: STDMETHOD(Invoke)(DISPID dispidMember,REFIID riid, LCID lcid, WORD wFlags,DISPPARAMS * pdispparams, VARIANT * pvarResult,EXCEPINFO * pexcepinfo, UINT * puArgErr) { ...... return S_OK; } After this the calls to the 'testmethod' and 'ondataavilable' from javascript do not go through? There are no exceptions but the scripts seems to skip these methods.What is wrong? Are any changes requied in the idl?

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      I'm not sure though. Try increasing major/minor version(at all occurances in your project) of your object. I found similar problem with newly added function to interface. And changing minor version does trick.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      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