确切的说是C#调用VC++编写的dll的问题
平台是VS2005
VC++编写的dll选的是Win32项目的那一种,不是MFC的问题:
在dll只写了一个导出函数的时候
在C#中
 [DllImport("motoman.dll"]
 public static extern int ServoOn();
调用没有出现问题在写入第二个导出函数,就出问题了
在C#中,
[DllImport("motoman.dll"]
public static extern int ServoOn();
public static extern int ServoOff();
运行的时候就说无法找到ServoOff方法但是如果我把上面的改成:
[DllImport("motoman.dll", EntryPoint = "ServoOn")]
public static extern int ServoOn();
[DllImport("motoman.dll", EntryPoint = "ServoOff")]
public static extern int ServoOff();
就又不会出现这种问题,不过这样在每次使用方法前都这么来一次我觉得比较麻烦
不知道各位有没有更好的方法没有?诚谢!