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. Managed C++/CLI
  4. Calling managed code from unmanaged C++

Calling managed code from unmanaged C++

Scheduled Pinned Locked Moved Managed C++/CLI
c++regexhelpannouncement
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.
  • L Offline
    L Offline
    Ludwig3
    wrote on last edited by
    #1

    Hi I currently use an implementation of the GoF observer pattern in C++. i.e. my observing class connects to a subject and then receives updates when it changes state. Having now waded into the Managed C++ arena I find the need to propagate the update call up into Managed C++ world from Unmanaged. My observers inherit from a class much like this: class Observer { public: virtual void Update(void) = 0; } I would love to be able to do the following: __gc class MyObserver : public Observer { ... } problem solved, but no, __gc classes cannot inherit from __nogc classes. I would like to find an approach which mimicks my existing technique as closely as possible. Thanks

    U 1 Reply Last reply
    0
    • L Ludwig3

      Hi I currently use an implementation of the GoF observer pattern in C++. i.e. my observing class connects to a subject and then receives updates when it changes state. Having now waded into the Managed C++ arena I find the need to propagate the update call up into Managed C++ world from Unmanaged. My observers inherit from a class much like this: class Observer { public: virtual void Update(void) = 0; } I would love to be able to do the following: __gc class MyObserver : public Observer { ... } problem solved, but no, __gc classes cannot inherit from __nogc classes. I would like to find an approach which mimicks my existing technique as closely as possible. Thanks

      U Offline
      U Offline
      ursus zeta
      wrote on last edited by
      #2

      You might read this information from MSDN: Interoperation with Unmanaged Code[^] Also, here's more: Interoperability in Managed Extensions for C++[^] Interop is a complex subject. It kind of depends on what exactly you want to Interop with. Is this a compiled DLL? A COM type library? Or, just a bunch of text source code? Most importantly are the data types compatible? If it was me, I'd just rewrite everything in .NET framework.

      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