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. Managed C++/CLI
  4. Add managed event handler function in unmanaged code

Add managed event handler function in unmanaged code

Scheduled Pinned Locked Moved Managed C++/CLI
csharpc++helptutorialquestion
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.
  • G Offline
    G Offline
    Gian
    wrote on last edited by
    #1

    Hello, i've inserted a .NET control in a MFC Dialog, i'd like to append functions to the events of the component but when i try to do (for example): component1->OnItemMove += new OnItemMoveEvent(this, myFunction) the compiler gives my a C3363 error, saying that i cannot create a delegate for OnItemMoveEvent from a member of a unmanaged class (the dialog class where myFunction is defined) or a non member function. Is there a "trick" to use .NET events from my MFC application or i cant do that in any way? Thank you, Gianmaria

    G 1 Reply Last reply
    0
    • G Gian

      Hello, i've inserted a .NET control in a MFC Dialog, i'd like to append functions to the events of the component but when i try to do (for example): component1->OnItemMove += new OnItemMoveEvent(this, myFunction) the compiler gives my a C3363 error, saying that i cannot create a delegate for OnItemMoveEvent from a member of a unmanaged class (the dialog class where myFunction is defined) or a non member function. Is there a "trick" to use .NET events from my MFC application or i cant do that in any way? Thank you, Gianmaria

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

      i've found this article http://www.developer.com/net/cplus/article.php/3391571 :)

      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