How to use existing C ++ code in .NET (C #)

I would like to create a C # project and implement existing native (C ++) code. Does anyone know of any good guidance on this?

Thanks!

+3
source share
6 answers

You can use P / Invoke, and you can call unmanaged methods. I will give you some examples: This is a link to the official MSDN documentation. This is a community website with most common unmanaged Windows libraries, along with signatures and sample methods

+4
source

++ ( ), , ++, - # ( ..) " ".

+3

, , , #, ++.

++/CLI , .

CodeProject .

++/CLI Action CodeProject, ++/CLI .

P/Invoke , , , , :

  • ,
  • , .

​​MSDN .

+3

, - ++/CLI, ++. ++ .Net, # . MSDN ++/CLI.

Interop C. ++.

0

, , , , : ++ ++/CLI . #. ++ - :

dotNetForm->Text = S"My Project"; // regular managed code
::SetWindowText(dotNetForm->Handle, "Your Project"); // mixed managed/unmanaged

# P/Invoke SetWindowText - , : , , ++ - , (.. ).

0
source

All Articles