Announcement

Collapse
No announcement yet.

Has the Win32api set been updated ....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Has the Win32api set been updated ....

    since Jan, 2005? That's the date on the one I'm using and the one in the downloads section of the PB site.

    I'm having a little trouble with a call that uses the IP_ADAPTER_INFO type from IpHlpApi.inc.

    Specifically:

    Code:
    LOCAL AdapInfo AS IP_ADAPTER_INFO
    Used in:

    Code:
    TRIM$(STR$(AdapInfo.Address))
    gives "invalid member/name" on "AdapInfo.Address"

    The api defines the type:

    Code:
    TYPE IP_ADAPTER_INFO
        pNext AS IP_ADAPTER_INFO PTR
        ComboIndex AS DWORD
        AdapterName AS STRING * (%MAX_ADAPTER_NAME_LENGTH + 4)
        Description AS STRING * (%MAX_ADAPTER_DESCRIPTION_LENGTH + 4)
        AddressLength AS DWORD
        Address(0 TO %MAX_ADAPTER_ADDRESS_LENGTH - 1) AS BYTE  'this is the offending member/name
        Index AS DWORD
        uType AS DWORD
        DhcpEnabled AS DWORD
        CurrentIpAddress AS IP_ADDR_STRING PTR
        IpAddressList AS IP_ADDR_STRING
        GatewayList AS IP_ADDR_STRING
        DhcpServer AS IP_ADDR_STRING
        HaveWins AS LONG
        PrimaryWinsServer AS IP_ADDR_STRING
        SecondaryWinsServer AS IP_ADDR_STRING
        LeaseObtained AS LONG
        LeaseExpires AS LONG
    END TYPE
    Do not go quiet into that good night,
    ... Rage, rage against the dark.

  • #2
    Because the 'address' member is a subscripted table, you have to refer to a specific occurence....

    Code:
      something = TRIM$(STR$(AdapInfo.Address[b](subscript)[/b]))
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      doh! :lam:

      Thank you.
      Do not go quiet into that good night,
      ... Rage, rage against the dark.

      Comment


      • #4
        Stan,

        If any interest in code that work with IP_ADAPTER_INFO
        then you may have a look at the AdaptersInfoGet function...

        Comment


        • #5
          Originally posted by Pierre Bellisle View Post
          Stan,

          If any interest in code that work with IP_ADAPTER_INFO
          then you may have a look at the AdaptersInfoGet function...

          http://www.powerbasic.com/support/pb...ad.php?t=29789

          Thank you, Pierre. That code of yours has everything I could possible want in it. And it is much cleaner code that what I've been writing. Thanks.

          Stan
          Do not go quiet into that good night,
          ... Rage, rage against the dark.

          Comment

          Working...
          X