Foxtable(狐表)用户栏目专家坐堂 → [求助]引用外部api出错


  共有12211人关注过本帖树形打印复制链接

主题:[求助]引用外部api出错

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/10/24 15:45:00 [显示全部帖子]

意思是这个dll格式不争取。

你是.net的库,还是传统的api库。


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/10/24 15:57:00 [显示全部帖子]

.net 按道理直接引用就行了,也许人家发给你的.dll有问题吧。

另外加密狗的库是.net的可能性不大。


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/10/24 16:51:00 [显示全部帖子]

显然,他是api的,不需要引用,只需定义函数即可。

在全局代码中加入:

 

Public Declare Function et_FindToken Lib "FT_ET99_API.dll" (ByVal et99pid As String, ByRef et99count As Short) As Integer
Public Declare Function et_OpenToken Lib "FT_ET99_API.dll" (ByRef et99handle As Integer, ByVal et99pid As String, ByVal et99index As Short) As Integer
Public Declare Function et_CloseToken Lib "FT_ET99_API.dll" (ByVal et99handle As Integer) As Integer
Public Declare Function et_Write Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByVal et99offset As Short, ByVal et99len As Short, ByRef et99write As Byte) As Integer
Public Declare Function et_Read Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByVal et99offset As Short, ByVal et99len As Short, ByRef et99read As Byte) As Integer
Public Declare Function et_Verify Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByVal et99flag As Short, ByVal et99pin As String) As Integer
Public Declare Function et_GetSN Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByRef et99sn As Byte) As Integer
Public Declare Function et_HMAC_MD5 Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByVal et99keyID As Integer, ByVal et99textLen As Short, ByRef et99pucText As Byte, ByRef et99pucDigest As Byte) As Integer
Public Declare Function MD5_HMAC Lib "FT_ET99_API.dll" (ByRef et99pucText As Byte, ByVal et99textLen As Integer, ByRef et99pucKey As Byte, ByVal et99keyLen As Integer, ByRef et99tokenKey As Byte, ByRef et99pucDigest As Byte) As Integer
Public Declare Function et_SetKey Lib "FT_ET99_API.dll" (ByVal et99handle As Integer, ByVal et99keyID As Integer, ByRef et99write As Byte) As Integer

Public Sub HexToString(ByRef ByteArray() As Byte, ByRef str_Renamed As String, ByRef lSize As Integer)
Dim b As Byte
Dim i As Integer
For i = lSize - 1 To 0 Step -1
    b = ByteArray(i) \ 16
    If b > 9 Then
        str_Renamed = str_Renamed & Chr(b + Asc("A") - 10)
    Else
        str_Renamed = str_Renamed & Chr(b + Asc("0"))
    End If
   
    b = ByteArray(i) Mod 16
    If b > 9 Then
        str_Renamed = str_Renamed & Chr(b + Asc("A") - 10)
    Else
        str_Renamed = str_Renamed & Chr(b + Asc("0"))
    End If
Next i
End Sub

[此贴子已经被作者于2011-10-24 16:54:43编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/10/25 10:20:00 [显示全部帖子]

删除所有Catch,包括foxtable安装目录和项目文件目录下的catch

 回到顶部