How to create own DLL in Visual Studio from C # code?

I have the source code of a C # program. I want to create from it a DLL that I want to use in C ++.

Is it possible to create a native DLL in Visual Studio 2008 that can be used in C ++?

+3
source share
5 answers

If you want the program to be native and not controlled, you will need to port it to C ++ instead of using C #.

As the saying goes, you can compile it in C # to a library and use it with C ++ using C ++ / CLI. It just requires that you compile files that use the C # library with the / clr flag. This provides C ++ access to the .NET platform and allows you to use libraries created in C # directly from C ++.

Alternatively, you can use .NET COM interaction to show a C # class (classes) as COM objects, and then use them from your own C ++.

+5
source

native ↔ .Net interop is one of my favorite disciplines, so I needed it as simple and reliable as possible.

As a result, I made me a task

+6
source

Visual Studio 2008, #.

DLL, , ++.

0

DLL COM. .

0

, . .
(, "visual ++" → ).
- " " .

(codeproject)
, , , DLL, ​​ DotNet Visual ++

0

Source: https://habr.com/ru/post/1718915/


All Articles