locked
Convert visual c# to visual c++ RRS feed

  • Question

  • Hi!

    I hope someone can help me.

    Its possible to convert visual c# to visual c++?

    how?

    Thanks

    Wednesday, July 11, 2012 4:21 PM

Answers

  • Hi,

    in general I would always suggest to not simply convert stuff from one language to another. Even that there might be tools: I made the experience that there are always complications and it is often quite hard to really test everything.

    So the easierst way to go is to have someone who knows both languages and who is then working on the translation.

    But feel free to look for such tools. Google showed me http://www.tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html as an example.

    And also important: Why do you want to translate from C# to C++? The result can be both more or less the same: An assembly with IL. If you want to get rid of .Net, then you really have to spend a lot of knowledge inside and find replacements for all used .Net stuff. You also have to take care of the memory deallocation! So it will be quite complex (and again shows that there might not be an easy way!)

    With kind regards,

    Konrad

    • Proposed as answer by Jason Dot Wang Friday, July 13, 2012 7:59 AM
    • Marked as answer by M_Max Sunday, July 15, 2012 6:53 PM
    Wednesday, July 11, 2012 4:31 PM

All replies

  • i guess it may not possible, it would be better to make an intermediate business layer that can talk in between or call one piece of code in the other one as per need.

    regards

    joon

    Wednesday, July 11, 2012 4:27 PM
  • You're not going to find some simple automatic online converter, no.  You'd need to do a full re-write of the code as the languages aren't even that similar.
    Wednesday, July 11, 2012 4:30 PM
  • Hi,

    in general I would always suggest to not simply convert stuff from one language to another. Even that there might be tools: I made the experience that there are always complications and it is often quite hard to really test everything.

    So the easierst way to go is to have someone who knows both languages and who is then working on the translation.

    But feel free to look for such tools. Google showed me http://www.tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html as an example.

    And also important: Why do you want to translate from C# to C++? The result can be both more or less the same: An assembly with IL. If you want to get rid of .Net, then you really have to spend a lot of knowledge inside and find replacements for all used .Net stuff. You also have to take care of the memory deallocation! So it will be quite complex (and again shows that there might not be an easy way!)

    With kind regards,

    Konrad

    • Proposed as answer by Jason Dot Wang Friday, July 13, 2012 7:59 AM
    • Marked as answer by M_Max Sunday, July 15, 2012 6:53 PM
    Wednesday, July 11, 2012 4:31 PM
  • C# and native C++ are quite different, but C# and C++/CLI are extremely close, so the latter conversion certainly would never require a re-write.

    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

    Wednesday, July 11, 2012 7:54 PM
  • And also important: Why do you want to translate from C# to C++? The result can be both more or less the same: An assembly with IL. If you want to get rid of .Net, then you really have to spend a lot of knowledge inside and find replacements for all used .Net stuff. You also have to take care of the memory deallocation! So it will be quite complex (and again shows that there might not be an easy way!)

    Can you image this theme?

    Joseph learnt C# and C# becomes his first choice if he want to write a window application. Now, he has a homework assigned by his teacher. He need to finish a program in C++. Joseph searched on the web and found this topic. He hopes he can finish the C++ homework but he can keep using .NET Framework.

    Jorney 


    <center title="Welcome to Justice Bar!"></center>


    • Edited by Jorney Friday, May 2, 2014 1:29 AM 1
    Friday, May 2, 2014 1:26 AM
  • How to link C# source file (say class1.cs) & CMakeLists.txt to C++ file (say Demo3.cpp) in Vusual Studio  2015 or 2017?



    Thursday, June 7, 2018 10:08 AM