WIN7下使用API gethostbyname 返回值为0,该如何解决

WIN7下使用API gethostbyname 返回值为0
先直接上代码
VB code
  Private Function getip(name As String) As String
        Dim hostent_addr     As Long
        Dim host     As HOSTENT
        Dim hostip_addr     As Long
        Dim temp_ip_address()     As Byte
        Dim i     As Integer
        Dim ip_address     As String
          
        hostent_addr = gethostbyname(name)
        If hostent_addr = 0 Then
              getip = ""                                               '主机名不能被解释
              Exit Function
        End If
          
        RtlMoveMemory host, hostent_addr, LenB(host)
        RtlMoveMemory hostip_addr, host.hAddrList, 4
          
        ReDim temp_ip_address(1 To host.hLength)
        RtlMoveMemory temp_ip_address(1), hostip_addr, host.hLength
          
        For i = 1 To host.hLength
              ip_address = ip_address & temp_ip_address(i) & "."
        Next
        ip_address = Mid$(ip_address, 1, Len(ip_address) - 1)
        getip = ip_address
    
  End Function

在Win7系统下,hostent_addr返回值为空,程序无法向下一步进行。但是在XP系统下却可以正常运行!
请教下哪里应该适当修改,可以兼容XP和WIN7呢??

------解决方案--------------------
域名和http://根本是两个概念,一个是DNS,一个是HTTP,建议使用时,无论是XP还是WIN7,均不要带http://。