Can you please tell me how to use a DLL written in C ++ in a C # project?

There is a ready-made library, which is provided by the manufacturer of devices and programs. Because the process of exporting to another format requires extra steps, I want to write my converter using their library. But I can not understand how to fasten it to my C # project.

Here is the link Section "Developers"

Tell me how to use the functionality of this library?

    2 answers 2

    To work with the library in another language, the DllImport attribute is used. About him you can read on the official website of Microsoft.

    Normally, a Warper class is created that wraps an unmanaged ticket with managed code. Inside this class, the interaction with liboy is described in a convenient form.

    When a user uses a wrapper class, the illusion of working with managed code is created.

      See Calling unmanaged functions from managed code .

      Note that there are two ways: first, using an explicit call to PInvoke through the DllImport attribute; the second is the implicit PInvoke, using C ++ / CLI.

      Which way is best depends on the circumstances. The first method is not applicable when you need to manually free the memory allocated in the unmanaged library. The second method is more universal, but requires knowledge of managed C ++. In general, you need to carefully study your dll.