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 / C++ / MFC
  4. how to use code written in C# in Managed C++ (VC++.NET) Project?

how to use code written in C# in Managed C++ (VC++.NET) Project?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++databasetutorialquestion
5 Posts 3 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.
  • A Offline
    A Offline
    AmbiguousName
    wrote on last edited by
    #1

    hello guys....i have written some code in C# (did some database work in C# using ADO.NET). Now I dont want to do that from scratch in vc, i just want to add that class to my vc prject and do my job. Is it possible, if yes how??....thnx

    L R 2 Replies Last reply
    0
    • A AmbiguousName

      hello guys....i have written some code in C# (did some database work in C# using ADO.NET). Now I dont want to do that from scratch in vc, i just want to add that class to my vc prject and do my job. Is it possible, if yes how??....thnx

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      when you build a DLL in one .NET language, it can be used by other DLL or EXE files created using another .NET language, without you actually see the language difference. Just make sure you add a reference to the DLL (solution pane), import the namespace (that would be a "using" in C#), and start using your other-language types. The above implies you meant C++/CLI, i.e. managed C++; and if you did, you actually are asking in the wrong forum. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

      A 1 Reply Last reply
      0
      • L Luc Pattyn

        when you build a DLL in one .NET language, it can be used by other DLL or EXE files created using another .NET language, without you actually see the language difference. Just make sure you add a reference to the DLL (solution pane), import the namespace (that would be a "using" in C#), and start using your other-language types. The above implies you meant C++/CLI, i.e. managed C++; and if you did, you actually are asking in the wrong forum. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        A Offline
        A Offline
        AmbiguousName
        wrote on last edited by
        #3

        Luc Pattyn wrote:

        you actually are asking in the wrong forum

        well since i was trying to add C# class to my managed C++ project so I thought this to be the right forum. Thanks anyways

        L 1 Reply Last reply
        0
        • A AmbiguousName

          Luc Pattyn wrote:

          you actually are asking in the wrong forum

          well since i was trying to add C# class to my managed C++ project so I thought this to be the right forum. Thanks anyways

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          The C/C++/MFC forum is for native code, i.e. unmanaged, non-dotnet stuff. The C++/CLI forum is for managed C++ code, as is used (by a few) in the .NET framework. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          1 Reply Last reply
          0
          • A AmbiguousName

            hello guys....i have written some code in C# (did some database work in C# using ADO.NET). Now I dont want to do that from scratch in vc, i just want to add that class to my vc prject and do my job. Is it possible, if yes how??....thnx

            R Offline
            R Offline
            Ram Shelke
            wrote on last edited by
            #5

            yes it can be done in vc also.

            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