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. "Unadvising" Event sink in VB6

"Unadvising" Event sink in VB6

Scheduled Pinned Locked Moved COM
helpcsharpc++com
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.
  • I Offline
    I Offline
    Ilia Blank
    wrote on last edited by
    #1

    I have COM object written in C# that exposes connection points and deployed as out of process server. I wrote VB6 application that supplies handler for the events fired by this COM object. To do that I added reference in my VB project to type library generated for C# COM. Next I used WithEvents statement in my VB code to declare variable of the events firing type exported from the COM. The application works fine. I can consume the events from the C# COM in my VB6 code. Problem arises when I stop my VB application. The delegate that implements the event in C# remains assigned and exception is thrown when attempt is made to call it. When you implement Event Sink say in C++ you use Advise – Unadvise paradigm to assign and clean up your handlers. What you supposed to do in VB6? Any help will be appreciated.

    G 1 Reply Last reply
    0
    • I Ilia Blank

      I have COM object written in C# that exposes connection points and deployed as out of process server. I wrote VB6 application that supplies handler for the events fired by this COM object. To do that I added reference in my VB project to type library generated for C# COM. Next I used WithEvents statement in my VB code to declare variable of the events firing type exported from the COM. The application works fine. I can consume the events from the C# COM in my VB6 code. Problem arises when I stop my VB application. The delegate that implements the event in C# remains assigned and exception is thrown when attempt is made to call it. When you implement Event Sink say in C++ you use Advise – Unadvise paradigm to assign and clean up your handlers. What you supposed to do in VB6? Any help will be appreciated.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Please don't cross post.

      --- b { font-weight: normal; }

      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