How to use a C ++ project from a .NET application?

I am a regular .NET developer who wants to integrate a C ++ library into a .NET project. I have a few ideas, but since I'm new to C ++ in general, I don't know the boundaries of the technology I'm trying to work with. A C ++ project is essentially a quick sound rendering that can play multi-track audio files with many different post-processing tricks. All this is cool, but considering that I have a simple .NET WinForms application that I want to integrate with, everything starts to seem messy.

  • Firstly, in a C ++ project, there are no .NET bindings or ActiveX / COM integration. This is a simple OL VC ++ 9 project. If I need to work with a project in my .NET application, I will have to somehow interface with it, i.e. create instances of classes, set properties, call methods, input and output marshal data, etc.

  • Secondly, it was created to work as an independent Windows application and manages its own windows using the MS Windows API. This is fine, but for some reason I need a .NET VM running in the background, managing the show and running all my C # code. I am not writing C ++, so I need to stick with C # to create an application around this library.

  • Thirdly, whether I am running in the same process as C ++ lib or not, I need a way to build / interface / debug these 2 separate applications, as if they were, I have no programming experience in C ++ , except for the fact that I wrote a couple of C ++ DLLs for high-performance data processing.

So many questions and don’t know how to start!

  • I can completely compile this library and get it in a VC EXE, but how can I compile my .NET code? Or, alternatively, how do I compile C ++ code in a .NET EXE so that it works in a managed environment? Please note that it was not intended for this and may work erroneously if I try to change too much.

  • . ++ .NET? , , /, .NET. .NET, .NET VM , . , ++ , .NET.

  • , - ? , , .

, , . !

: - , P/Invoke ++ ? ++? .NET ?

+5
2

1

++, , ++/CLI, , , , , ++/CLI , ++, , gcnew. , .NET, . , .

, Frobber. ++/CLI ManagedFrobber, , Frobber, Frobber. ManagedFrobber Frobber . ManagedFrobber Frobber . - Frobber.

2

, ++, - c-style ( #, , ), P/Invoke, , , . , , -, , , .NET . P/Invoke .

+3

All Articles