C# – How to bind c++ dll to the C# program – winCE

cdllwindows-ce

i need to bind C++ dll to my C# WinCE program. (scanner dll)

how i can do it ?

thank's in advance

Best Answer

You need to use Interop to call into unmanaged code.

using System.Runtime.InteropServices; // DllImport
public class Win32 {
  [DllImport("User32.Dll")]
  public static extern void SetWindowText(int h, String s);
}

Here is an article that discusses the topic in detail (also where the code is sourced from).

http://msdn.microsoft.com/en-us/magazine/cc301501.aspx