KdgDev KdgDev - 1 year ago 83
C# Question

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

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 be added and to please check if the is accessible, a valid assembly or COM component.

I have no C++ experience, though I would like to use the functionality. Right now I'm using

from the .NET framework to call lame.exe and do stuff, but I'd like to know if there's another way.

Answer Source

You have to use P/Invoke to call unmanaged APIs from managed code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download