Using STANDARD C++ within another Projects like C#
-
Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)
-
Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)
-
Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)
You cannot directly use native C++ code in C#. You can create a native C++ DLL and then do DLL interop from C#.
«_Superman_» I love work. It gives me something to do between weekends.
-
You cannot directly use native C++ code in C#. You can create a native C++ DLL and then do DLL interop from C#.
«_Superman_» I love work. It gives me something to do between weekends.
Thank you It would be better if you told me how to do that and again thank you
-
Hi I want to use a C++ program as a part of a project in C# and I know how can I do this when the program is Managed CPP But I want to know how can I include my Standard Cpp code in a C# project and I use Visual Studio 2008 and I want to know is there any template for creating a standard CPP project apart from the "Empty Project"? I appreciate your answers thank you :)
Hi, I'll recommend that you write everything in managed code, or everything in native language as much as possible. If you mix them both, you don't get the best of both worlds, but in most cases, you get the worst of both worlds. Like the other person said, you cannot directly use C++ code in a managed application. Try converting that to managed C++. Keep COM interop as the last option (there are several articles on CP and msdn, if you decide to, just do a search).
It is a crappy thing, but it's life -^ Carlo Pallini
-
Thank you It would be better if you told me how to do that and again thank you
Here is one such tutorial. http://dotnetperls.com/Content/DllImport-Interop.aspx[^] And you will find lots of it on MSDN.
«_Superman_» I love work. It gives me something to do between weekends.