1

I am typing a software that uses .exe files programmed in a separate language. The software is in C#, the .exe files in C++.
Is there a way I can change those standalone .exe files into something that is non-executable for any given user but can still be used by my C# program?

If that is not feasible, then, is it possible to build a project/solution that uses multiple languages into one executive program?

Bilal Siddiqui
  • 349
  • 3
  • 17
Sam Rafiei
  • 73
  • 8
  • 4
    You could turn the C++ code into a library and call that library from your C# code. – NathanOliver Aug 20 '18 at 20:51
  • 1
    @NathanOliver Thank you, Ill do some research on how to do that, Sorry I'm not that familiar with this language and just learning :)) – Sam Rafiei Aug 20 '18 at 20:54
  • I would recommend porting the code over. It will be a good learning exercise if nothing else. Failing that, it is possible to load a c++ dll from within C#. I wouldn't recommend this, but it will be another learning experience. If your goal here is to learn, rather than ship software, perhaps you should forget about "protecting" the code and focus on learning what you will need to ship software. This SO question highlights the issues fairly well. tldr: nobody wants your source code. https://stackoverflow.com/questions/2478230/how-can-i-protect-my-net-assemblies-from-decompilation – speciesUnknown Aug 20 '18 at 21:16
  • Are you talking executables or dynamic linked libraries (DLL). Executables have no relationship to their creation language. You could have executables created by Visual Basic or Fortran. The OS must be used to execute them. – Thomas Matthews Aug 20 '18 at 21:47
  • @gburton ill check that out too and see which one would work better in my situation, but I'm glad you told me about these new ways so I learn about them. – Sam Rafiei Aug 20 '18 at 22:30
  • @ThomasMatthews: Most language implementations use a runtime support library, which definitely links the executable to the creation language. – MSalters Aug 21 '18 at 08:24
  • @MSalters, so given any executable, it's source language can be determined? Does this include mixed languages, e.g. Fortran & C? – Thomas Matthews Aug 21 '18 at 13:59
  • @ThomasMatthews: Generally, yes, and you can determine the compiler too. It's far easier when the support library is in a DLL (or a few DLLs, for mixed languages) – MSalters Aug 21 '18 at 14:46

0 Answers0