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. C#
  4. managed c++ class that inherits from unmanaged c++

managed c++ class that inherits from unmanaged c++

Scheduled Pinned Locked Moved C#
c++question
6 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.
  • G Offline
    G Offline
    godzooky
    wrote on last edited by
    #1

    is it possible to have a managed c++ class that inherits from an unmanaged c++ class? if so, how would i do that?

    H 1 Reply Last reply
    0
    • G godzooky

      is it possible to have a managed c++ class that inherits from an unmanaged c++ class? if so, how would i do that?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Wrong forum. Try the Managed C++ forum. This is for C#.

      Microsoft MVP, Visual C# My Articles

      G 1 Reply Last reply
      0
      • H Heath Stewart

        Wrong forum. Try the Managed C++ forum. This is for C#.

        Microsoft MVP, Visual C# My Articles

        G Offline
        G Offline
        godzooky
        wrote on last edited by
        #3

        sorry. i meant c# class that inherits from unmanaged c++. is there a way to accomplish this?

        H 1 Reply Last reply
        0
        • G godzooky

          sorry. i meant c# class that inherits from unmanaged c++. is there a way to accomplish this?

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          No. You would have to encapsulate this unmanaged C++ class in a managed class. The easiest way would be to create a mixed mode Managed C++ assembly that encapsulates this in a managed class, then extend that from C#.

          Microsoft MVP, Visual C# My Articles

          G 1 Reply Last reply
          0
          • H Heath Stewart

            No. You would have to encapsulate this unmanaged C++ class in a managed class. The easiest way would be to create a mixed mode Managed C++ assembly that encapsulates this in a managed class, then extend that from C#.

            Microsoft MVP, Visual C# My Articles

            G Offline
            G Offline
            godzooky
            wrote on last edited by
            #5

            Heath Stewart wrote: easiest way would be to create a mixed mode Managed C++ assembly that encapsulates this in a managed class ok. can you point me to some info about that? thanks.

            H 1 Reply Last reply
            0
            • G godzooky

              Heath Stewart wrote: easiest way would be to create a mixed mode Managed C++ assembly that encapsulates this in a managed class ok. can you point me to some info about that? thanks.

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              Um, try the .NET Framework SDK. You did install that with Visual Studio .NET or with the .NET Framework SDK download, did you not? Specifically, see Managed Extensions for C++ Programming[^] in the VS.NET product documentation. Most importantly, remember that the managed code has the same access to .NET assemblies (including the base class library) that every other .NET language. That's the whole point of language interoperability.

              Microsoft MVP, Visual C# My Articles

              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