求大师指点,传进去参数后得到的数据一部分是错误的,是不是数据长度小了呢?

羽熙 2015-03-11 05:42:47
Public Type DS_INFO_ 'typedef struct _DS_INFO
apid As Long 'Application ID,定义防火墙版本号
hwid As Integer '硬件ID,定义网关硬件版本号
flag As Integer '用于内部使用,不要修改
real_ip_addr As Long '网管的真实IP地址。常规使用中,用户可以忽略此域值
pseudo_ip_addr As Long '伪网关的IP地址。使用这个地址和网关通信。如果网关被定位为内部NAT网络,这就是被NAT服务器标志的伪网关的IP地址。如果网关没有使用任何的NAT,这个值和真实的IP地址相同
host_ip_addr As Long '主机的IP地址。使用这个值就可以知道网关连接的是哪个主机硬件接口
mac(MACLEN) As Byte '6字节的MAC地址。如果MAC地址是"00-90-E8-01-02-03", MAC[0]就是0,MAC[1]就是0x90(hex),MAC[2]就是0xE8(hex)等等,
End Type

Public Function myEnumSearchProc(ByRef dsinfo As DS_INFO_) As Long
mySearchInfo(search_count).dshdl = -1
If (dsinfo.hwid = NE4100T) Then
modelstring = "Found: NE4100T" & txtstring
CopyMemory mySearchInfo(search_count).ds_info, dsinfo, LenB(mySearchInfo(search_count).ds_info)
search_count = search_count + 1
ElseIf (dsinfo.hwid = NE4110S) Then
modelstring = "Found: NE4110S" & txtstring
CopyMemory mySearchInfo(search_count).ds_info, dsinfo, LenB(mySearchInfo(search_count).ds_info)

Debug.Print mySearchInfo(search_count).ds_info.apid'错
Debug.Print mySearchInfo(search_count).ds_info.hwid'正确
Debug.Print mySearchInfo(search_count).ds_info.flag'正确
Debug.Print mySearchInfo(search_count).ds_info.real_ip_addr'错
Debug.Print mySearchInfo(search_count).ds_info.pseudo_ip_addr'错
Debug.Print mySearchInfo(search_count).ds_info.host_ip_addr'错

Dim ij As Integer
For ij = 0 To 5
Debug.Print mySearchInfo(search_count).ds_info.mac(ij)
Next

search_count = search_count + 1
End If
End Function
...全文
62 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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