CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Retrieve IP information on any Windows

    I used to retrieve IP and NIC information by querying windows registry. Now I'm trying to use GetAdapterAddresses() API. Using GetAdapterAddresses() to get IP is not that easy, I need to dig a long deep as I check some examples so far, anyways my question is: Calling this API will return success on all versions of Windows ie: 32bits & 64bits ?

    Though Microsoft has not opened any source any one can give me an idea from where this API is actually retrieving Windows IP information.?. Is it reading Registry or some windows file.
    ◄◄ hypheni ►►

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Retrieve IP information on any Windows

    Well, MSDN very clear states:
    Requirements
    Minimum supported client
    Windows XP
    Minimum supported server
    Windows Server 2003
    Header
    Iphlpapi.h
    Library
    Iphlpapi.lib
    DLL
    Iphlpapi.dll
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Retrieve IP information on any Windows

    As a general answer, MSDN states the minimum required operating system for every API that it documents. You better check that requirements section next time you use some API.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Retrieve IP information on any Windows

    Yes, I did check the API's support, but some says on feedback it doesn't work on Win 7 64bits, anyways which one is better. API or Registry manipulation ?
    ◄◄ hypheni ►►

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Retrieve IP information on any Windows

    Quote Originally Posted by hypheni View Post
    ... anyways which one is better. API or Registry manipulation ?
    Better is using API.
    What if Microsoft will change some registry entries in the next Windows version? Then they also change corresponding API code so you won't need to change anything in your projects!
    Victor Nijegorodov

  6. #6
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Retrieve IP information on any Windows

    Well, thanks.
    ◄◄ hypheni ►►

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Retrieve IP information on any Windows

    Maybe the 64-bit version issue is related to this http://support.microsoft.com/kb/2588...rss&spid=14019 ?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured