Loading a C++ DLL in C#

The correct syntax is as follows.

using System;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Company.Group
{
    public class FuncList
    {
        [DllImport("MarkEzd.dll", EntryPoint = "lmc1_Initial2", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
        public static extern int Initialize(string PathName, bool TestMode);
    }
}

Use P-Invoke to call native DLL. You might have to marshall some datatype in order to make it work.

http://msdn.microsoft.com/en-us/library/aa288468.aspx

Tags:

C#

C++