大概的看了,总结一下。
用C#来表述,这三个函数是关键:
[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern bool Checked(int[] ucpcSquares, int SdPlayer);
[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GenerateCapture(int[] ucChessBoard, int[] Mvs, int SdPlayer);
[DllImport("GenerateMoves.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GenerateMoves2(int[] ucChessBoard, int[] Mvs, int SdPlayer);
亦或,用来表述,这三个函数是关键:
<DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function Checked(ByVal ucpcSquares As Integer(), ByVal SdPlayer As Integer) As Boolean
<DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function GenerateCapture(ByVal ucChessBoard As Integer(), ByVal Mvs As Integer(), ByVal SdPlayer As Integer) As Integer
<DllImport("GenerateMoves.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Public Shared Function GenerateMoves2(ByVal ucChessBoard As Integer(), ByVal Mvs As Integer(), ByVal SdPlayer As Integer) As Integer
换句话来说:GenerateMoves.dll这个C++的动态链接库文件才是重点也是关键。