在DLL中,有一个这样的函数(VC):
int hst_open(long chno, INITTBL *inittbl)我现在在Delphi里如何调用它?
小猫多谢啦.

解决方案 »

  1.   

    Parameter:
    chno Channel No.
    0~typedef struct INITTBL { Initialization table
    long speed Transmission speed
    0:1200bps, 1:2400bps, 2:4800bps, 3:9600bps, 4:19200bps
    long length Data length
    0:8bit, 1:7bit
    long parity Parity
    0:None, 1:odd parity, 2:Even parity
    long sbit Stop bit
    1:1bit, 2:2bit
    long ptout Polling timeout
    30~300mm second
    long ctout Communication time out
    500~10000mm second
    long cretry Number of communication retry
    0~99 times
    long stopkey1 Interrupt key① designation. Valid only in console mode.
    See the below setting figure.
    long stopkey2 Interrupt key② designation. Valid only in console mode.
    See the below setting figure.
    } inittbl
      

  2.   

    type PINITTBL = ^INITTBL;int hst_open(long chno, INITTBL *inittbl)->
    function hst_open(chno:long; inittbl:PINITTBL):Integer; external 'xxx.dll';name 'hst_open'待会给你转一下 结构体的转化。