也许Delphi的下一个版本Delphi.net可以吧!

解决方案 »

  1.   

    在引用中添加一个DLL引用,
    在程序中创建一个这个引用的实例,
    就可以调用他的方法。
      

  2.   

    同意 cwfz(Search)先添加引用!
    然后创建(new) 实例。
      

  3.   

    看看有没有帮助
    //测试调用chdcomm.dll
    public class CHDComm
    { //打开串口
    [DllImport("CHDComm.dll", EntryPoint="OpenCom", CharSet=CharSet.Auto)]
    public static extern int OpenCom1(string ComPort,int BaundRate);
    //关闭串口
    [DllImport("CHDComm.dll", EntryPoint="CloseCom", CharSet=CharSet.Auto)]
    public static extern int CloseCom(); }


    private void Button1_Click(object sender, System.EventArgs e)
    {
    int ret1,ret2;
    //打开串口
    ret1 =CHDComm.OpenCom1("COM1",9600);
    TextBox1.Text = ret1.ToString();

    //关闭串口
    ret2 = CHDComm.CloseCom();
    TextBox2.Text = ret2.ToString(); }