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. Handling Events in COM takes time

Handling Events in COM takes time

Scheduled Pinned Locked Moved COM
c++comhelp
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.
  • A Offline
    A Offline
    arun1405
    wrote on last edited by
    #1

    Hi Folks, I am trying to add EVENT HANDLING in the COM component (attributed) in Visual C++ 7.1. But, it takes a lot of time (around 250 ms on my machine) while executing "__raise" method call for each event. This is a serious problem for me as a typical operation in my program throws around 50 events and when 250 ms are clubbed together for these 50 events, the overall operation takes hell lot of time) Following is the event related code I have added in my program: ***************************************************************** [ dispinterface, nonextensible, uuid("4700BB55-A9D2-46f8-A453-EF8F9658E56F"), helpstring("_IMyEvents Interface") ] __interface _IMyEvents { [id(1), helpstring("method OnDataChanged")] HRESULT OnDataChanged(); } class ATL_NO_VTABLE CMyData : public IMyData { public: CMyData (); virtual ~CMyData (); __event __interface _IMyEvents; HRESULT FireOnDataChanged() { __raise OnDataChanged(); // THIS CALL TAKES TIME } ---------- ---------- } ***************************************************************** I would look forward to your suggestions & comments. Regards, Arun.

    A 1 Reply Last reply
    0
    • A arun1405

      Hi Folks, I am trying to add EVENT HANDLING in the COM component (attributed) in Visual C++ 7.1. But, it takes a lot of time (around 250 ms on my machine) while executing "__raise" method call for each event. This is a serious problem for me as a typical operation in my program throws around 50 events and when 250 ms are clubbed together for these 50 events, the overall operation takes hell lot of time) Following is the event related code I have added in my program: ***************************************************************** [ dispinterface, nonextensible, uuid("4700BB55-A9D2-46f8-A453-EF8F9658E56F"), helpstring("_IMyEvents Interface") ] __interface _IMyEvents { [id(1), helpstring("method OnDataChanged")] HRESULT OnDataChanged(); } class ATL_NO_VTABLE CMyData : public IMyData { public: CMyData (); virtual ~CMyData (); __event __interface _IMyEvents; HRESULT FireOnDataChanged() { __raise OnDataChanged(); // THIS CALL TAKES TIME } ---------- ---------- } ***************************************************************** I would look forward to your suggestions & comments. Regards, Arun.

      A Offline
      A Offline
      arun1405
      wrote on last edited by
      #2

      One more clue: This COM component accesses a webservice and invoke some methods on it. The webservice is deployed in the Tomcat Container. (May be this is creating some problem)

      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