VB调用的动态库是
Declare Sub GetKHTState Lib "mtudll.DLL" (ByVal port As Long, ByRef state As Integer)
现在我要把此调用的动态库换成DELPHI的,不知道如何处理。
以下是VB代码,state定义的是as integer,port as integer
GetKHTState port, state
If state And &HF Then
'Text3 = Right(Text3, 200) & "port" & port & "=" & Hex(state) & vbCrLf
Text3 = Right(Text3, 500) & " port=" & port _
& "->来电=" & IIf(state And &H1, "1", "0") _
& " 振铃=" & IIf(state And &H2, "1", "0") _
& " 错误=" & IIf(state And &H4, "1", "0") _
& " dtmf=" & IIf(state And &H8, "1", "0") _
& " Dtmf=" & ((state And &HF0) / 16) & vbCrLf _
& "------------------" & vbCrLf
End If
我要把他换成DELPHI,不知道如何处理,分不够再加。谢谢了,待急。
Declare Sub GetKHTState Lib "mtudll.DLL" (ByVal port As Long, ByRef state As Integer)
现在我要把此调用的动态库换成DELPHI的,不知道如何处理。
以下是VB代码,state定义的是as integer,port as integer
GetKHTState port, state
If state And &HF Then
'Text3 = Right(Text3, 200) & "port" & port & "=" & Hex(state) & vbCrLf
Text3 = Right(Text3, 500) & " port=" & port _
& "->来电=" & IIf(state And &H1, "1", "0") _
& " 振铃=" & IIf(state And &H2, "1", "0") _
& " 错误=" & IIf(state And &H4, "1", "0") _
& " dtmf=" & IIf(state And &H8, "1", "0") _
& " Dtmf=" & ((state And &HF0) / 16) & vbCrLf _
& "------------------" & vbCrLf
End If
我要把他换成DELPHI,不知道如何处理,分不够再加。谢谢了,待急。
解决方案 »
- 求教:关于rmport 打印问题
- 开发网游需求delphi多还是c++多?
- 推荐一个小软件:拼拼看 1.0版(我费了一个多星期整出来的)
- 请问如何将我下述的treeview的记录显示到edit文本筐里?
- 字体位置及大小控制问题
- 如何将一个二进制的文件读到数组之中。急啊。解决之后分数可以再加
- 谁知道qtintf.dll干嘛用的?我的程序发布后老提示找不到该文件。
- 简单,在线等待,最简单的办法取字符串回车后的内容
- 请问用WINSOCK编程发送邮件,如何判断是否需要SMTP验证?如何进行验证?(不是用控件,看清楚)
- 各位,哪里有好的Delphi教程下载?
- 请高手指点,这段DLL代码!不甚感谢
- delphi版本兼容/声明错误问题???求助大家了
procedure GetKHTState(port: Cardinal; state: integer); stdcall; external mtudll name 'GetKHTState';代码:
GetKHTState(port, state);
If state And &HF > 0 Then
begin
Text3 := Right(Text3, 500) + ' port=' + IntToStr(port) +
'->来电=';
If state And &H1 > 0 Then
Text3:=Text3+'1'
else
Text3:=Text3+'0';
Text3:=Text3+' 振铃=';
If state And &H2 > 0 Then
Text3:=Text3+'1'
else
Text3:=Text3+'0';
Text3:=Text3+' 错误=';
If state And &H4 > 0 Then
Text3:=Text3+'1'
else
Text3:=Text3+'0';
Text3:=Text3+' dtmf=';
If state And &H8 > 0 Then
Text3:=Text3+'1'
else
Text3:=Text3+'0';
Text3:=Text3+' Dtmf=' + IntToStr((state And &HF0) / 16) + #13#10
+ '------------------' + #13#10;
End;//这里Text3是当作字符串来操作的,如果是控件,你需要用Text3.Text或Text3.Caption来进行操作
delphi定义成state: integer,一下就报错了,
state and $1
这样肯定也会报错的啊。