你搞得定吗?dll

sensory 2003-07-30 11:40:41
VB下的dll文件调用申明如下:请问DELPHI下因该怎样声明???3x

Declare Function read_ch_data Lib "k800.dll" (ByVal nPort As Integer, ByVal ch As Byte, ByVal d1 As Long, ByVal d2 As Long) As Integer
Declare Sub out_port Lib "k800.dll" (ByVal nPort As Integer, ByVal cValue As Byte)
Declare Function in_port Lib "k800.dll" (ByVal nPort As Integer) As Byte
...全文
37 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiume 2003-07-30
  • 打赏
  • 举报
回复
ouyang75928(Thinking in Pascal)
说的没错,这回又晚了
jerrymousenet2 2003-07-30
  • 打赏
  • 举报
回复
firetoucher(风焱) 说的有些不太对,VB中的byValu是传值方式,byRef才是按传引用的方式传参的。在delphi中byRef对应得加个var,byvalue的话不用加var.
jerrymousenet2 2003-07-30
  • 打赏
  • 举报
回复
unit Unit2;

interface

function read_ch_data(nPort: Integer; ch: Byte; d1: Integer; d2: Integer): Integer;

procedure out_port(nPort: Integer; cValue: Byte);

function in_port(nPort: Integer): Byte;

implementation

function read_ch_data; external 'k800.dll' name 'read_ch_data';

procedure out_port(nPort: Integer; cValue: Byte); external 'k800.dll' name 'out_port';

function in_port(nPort: Integer): Byte; external 'k800.dll' name 'in_port';


end.
firetoucher 2003-07-30
  • 打赏
  • 举报
回复
function read_ch_data (var nPort:integer;var ch:Byte;var d1,s2:LONG;):Integer;stdcall extern "k800.dll"
其他雷同

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧