Adding C++ DLL's to a C# project

前端 未结 4 1659
误落风尘
误落风尘 2021-02-13 20:58

I\'m trying to use the lame_enc.dll file from LAME in a C# project, but adding the thing seems impossible.

I keep getting an error that says that a reference could not b

4条回答
  •  耶瑟儿~
    2021-02-13 21:25

    To use an unmanaged dll (native C++) in C#, you have to use DllImport, not adding a reference to the project in visual studio (and that is why you get an error).

    Here is the documentation of DllImport from the MSDN.

提交回复
热议问题