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

前端 未结 4 1555
误落风尘
误落风尘 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:39

    You will need to use PInvoke to call functions in your native lame dll. However, you will only be able to call functions that have been exported as "C" style.

    You can use a tool like "PInvoke Interop Assistant" that will help you when working out the PInvoke call signatures to make calls from C# to your native dll:

    http://clrinterop.codeplex.com/releases/view/14120

提交回复
热议问题