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. .NET (Core and Framework)
  4. Using .NET with big C program?

Using .NET with big C program?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++question
6 Posts 4 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.
  • C Offline
    C Offline
    chilituna
    wrote on last edited by
    #1

    Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:

    J C M 3 Replies Last reply
    0
    • C chilituna

      Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:

      J Offline
      J Offline
      James Gupta
      wrote on last edited by
      #2

      No, unfortunately C compiles to native code, wheras .NET compiles into MSIL before being run. This means that .NET classes are completely unaccessable by C. What are you looking to do? is there no native method to do the same operation?

      F 1 Reply Last reply
      0
      • J James Gupta

        No, unfortunately C compiles to native code, wheras .NET compiles into MSIL before being run. This means that .NET classes are completely unaccessable by C. What are you looking to do? is there no native method to do the same operation?

        F Offline
        F Offline
        Felipe Dalorzo
        wrote on last edited by
        #3

        That is not completly true C# and C++ can talk, in COM language. You can compile one site into COM and then share it as components. Greetings, Felipe

        1 Reply Last reply
        0
        • C chilituna

          Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:

          C Offline
          C Offline
          chilituna
          wrote on last edited by
          #4

          Thanks for advice, I guess I'll have to try some other approach. It's just that .NET has some neat features, I'd like to use..

          J 1 Reply Last reply
          0
          • C chilituna

            Thanks for advice, I guess I'll have to try some other approach. It's just that .NET has some neat features, I'd like to use..

            J Offline
            J Offline
            James Gupta
            wrote on last edited by
            #5

            C# syntax is very similar to other languages, if you could just object-orient your C code, even very crudely it may be worth the swap... - and you can access WinAPI calls from .NET languages.

            1 Reply Last reply
            0
            • C chilituna

              Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:

              M Offline
              M Offline
              Mike Dimmick
              wrote on last edited by
              #6

              As the others have posted, you can use COM interop, but you may get better results using the .NET Hosting APIs. For information, see "Hosting Interfaces.doc" under the .NET Framework SDK directory (typically C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide). See also What Is CLR Hosting[^]. Stability. What an interesting concept. -- Chris Maunder

              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