请高手们帮忙解决一下C#怎样调用c++写的DLL
我的代码如下:public partial class Form1 : Form
{
[DllImport("LOTcontroller.dll")]
private static extern HANDLE OpenPort(int port,int baud);
[DllImport("LOTcontroller.dll")]
private static extern BOOL ClosePort(HANDLE m_hComm);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
HANDLE a = OpenPort(2,9600);
bool b = CloseReason(a);
if (b == true)
{
MessageBox.Show("已经关闭!");
}
}
}
在运行的时候提示:缺少Using 指令或程序集