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. C#
  4. Can C++ & C# co-exist in the same project?

Can C++ & C# co-exist in the same project?

Scheduled Pinned Locked Moved C#
c++questioncsharp
5 Posts 5 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
    Li kai Liu Angus
    wrote on last edited by
    #1

    Hi, Sorry, I know it maybe a bit dumb to ask this question. But if I wrote class library that inherit some MFC classes, can I use them in my C# project? Thank you in advance:)

    L J N A 4 Replies Last reply
    0
    • L Li kai Liu Angus

      Hi, Sorry, I know it maybe a bit dumb to ask this question. But if I wrote class library that inherit some MFC classes, can I use them in my C# project? Thank you in advance:)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you used managed C++, then I believe so. Ask in the MC++ forum to be sure.

      1 Reply Last reply
      0
      • L Li kai Liu Angus

        Hi, Sorry, I know it maybe a bit dumb to ask this question. But if I wrote class library that inherit some MFC classes, can I use them in my C# project? Thank you in advance:)

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        They can't live in the *same* project, but you can use them together if you write an MC++ class library which wraps the MFC classes, then you can use that from a C# app, rather easily I might add :) The hard/tedious part is going to be wrapping the MFC class. James Simplicity Rules!

        1 Reply Last reply
        0
        • L Li kai Liu Angus

          Hi, Sorry, I know it maybe a bit dumb to ask this question. But if I wrote class library that inherit some MFC classes, can I use them in my C# project? Thank you in advance:)

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          Chris has written a really good article just the other day on this subject, check it out: Cross language inheritance in .NET Nick Parker

          1 Reply Last reply
          0
          • L Li kai Liu Angus

            Hi, Sorry, I know it maybe a bit dumb to ask this question. But if I wrote class library that inherit some MFC classes, can I use them in my C# project? Thank you in advance:)

            A Offline
            A Offline
            Albert Pascual
            wrote on last edited by
            #5

            They can leave in the same solution so you can P/Invoke the C# or the unmanged code from C# Al

            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