Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VS2010 - version and copyright and GetAdapters

VS2010 - version and copyright and GetAdapters

Scheduled Pinned Locked Moved C / C++ / MFC
pythonhelpquestionannouncementlearning
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ed SHaw
    wrote on last edited by
    #1

    I used to get the version and copyright from the resource files using the following char ThisProgramsName[256]=""; GetModuleFileName(AfxGetInstanceHandle(),ThisProgramsName,256); DWORD dwHandle = 0; DWORD dwSize = GetFileVersionInfoSize( ThisProgramsName,&dwHandle ); if(dwSize!=0L) { UINT uVerInfoSize; char *lpVerInfo = new char[dwSize]; GetFileVersionInfo(ThisProgramsName, dwHandle, dwSize,lpVerInfo ); The libraries have all changed in VS2010. What do I need to link to satisfy these calls, or has the method of retrieving this information changed. Same question for GetAdapters This is the old code PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter = NULL; DWORD dwRetVal = 0; UINT i; unsigned long LowestHexIP, PossibleIP; char MacByte[4], MacID[16], LowestMacID[16]; ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (sizeof(IP_ADAPTER_INFO)); // Make an initial call to GetAdaptersInfo to get // the necessary size into the ulOutBufLen variable if (GetAdaptersInfo (pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) { FREE (pAdapterInfo); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (ulOutBufLen); } ES

    L D 2 Replies Last reply
    0
    • E Ed SHaw

      I used to get the version and copyright from the resource files using the following char ThisProgramsName[256]=""; GetModuleFileName(AfxGetInstanceHandle(),ThisProgramsName,256); DWORD dwHandle = 0; DWORD dwSize = GetFileVersionInfoSize( ThisProgramsName,&dwHandle ); if(dwSize!=0L) { UINT uVerInfoSize; char *lpVerInfo = new char[dwSize]; GetFileVersionInfo(ThisProgramsName, dwHandle, dwSize,lpVerInfo ); The libraries have all changed in VS2010. What do I need to link to satisfy these calls, or has the method of retrieving this information changed. Same question for GetAdapters This is the old code PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter = NULL; DWORD dwRetVal = 0; UINT i; unsigned long LowestHexIP, PossibleIP; char MacByte[4], MacID[16], LowestMacID[16]; ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (sizeof(IP_ADAPTER_INFO)); // Make an initial call to GetAdaptersInfo to get // the necessary size into the ulOutBufLen variable if (GetAdaptersInfo (pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) { FREE (pAdapterInfo); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (ulOutBufLen); } ES

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Ed SHaw wrote:

      The libraries have all changed in VS2010.

      I'm not sure this is strictly accurate, according to the GetFileVersionInfo[^] page on MSDN you need Version.lib, and I know from my own projects that this has not changed for some time. I expect GetAdapters will have a similar information page that you can look at.

      It's time for a new signature.

      E 1 Reply Last reply
      0
      • L Lost User

        Ed SHaw wrote:

        The libraries have all changed in VS2010.

        I'm not sure this is strictly accurate, according to the GetFileVersionInfo[^] page on MSDN you need Version.lib, and I know from my own projects that this has not changed for some time. I expect GetAdapters will have a similar information page that you can look at.

        It's time for a new signature.

        E Offline
        E Offline
        Ed SHaw
        wrote on last edited by
        #3

        Do you know where I can download the latest version.lib and IPHlpApi.lib for both win32 and x64?

        L 1 Reply Last reply
        0
        • E Ed SHaw

          I used to get the version and copyright from the resource files using the following char ThisProgramsName[256]=""; GetModuleFileName(AfxGetInstanceHandle(),ThisProgramsName,256); DWORD dwHandle = 0; DWORD dwSize = GetFileVersionInfoSize( ThisProgramsName,&dwHandle ); if(dwSize!=0L) { UINT uVerInfoSize; char *lpVerInfo = new char[dwSize]; GetFileVersionInfo(ThisProgramsName, dwHandle, dwSize,lpVerInfo ); The libraries have all changed in VS2010. What do I need to link to satisfy these calls, or has the method of retrieving this information changed. Same question for GetAdapters This is the old code PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter = NULL; DWORD dwRetVal = 0; UINT i; unsigned long LowestHexIP, PossibleIP; char MacByte[4], MacID[16], LowestMacID[16]; ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (sizeof(IP_ADAPTER_INFO)); // Make an initial call to GetAdaptersInfo to get // the necessary size into the ulOutBufLen variable if (GetAdaptersInfo (pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) { FREE (pAdapterInfo); pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC (ulOutBufLen); } ES

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Ed SHaw wrote:

          What do I need to link to satisfy these calls...

          What linker error(s) are you receiving?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          E 1 Reply Last reply
          0
          • D David Crow

            Ed SHaw wrote:

            What do I need to link to satisfy these calls...

            What linker error(s) are you receiving?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            E Offline
            E Offline
            Ed SHaw
            wrote on last edited by
            #5

            Undefined's for GetFileVersionInfoSize(), GetFileVersionInfo(), VerQueryValue()and GetAdaptersInfo(). I think I need version.lib and IPHlpApi.lib for x64 build. I put in the old version for win32 and they build and run ok. I expected new versions of everything with new VS2010 Ed

            1 Reply Last reply
            0
            • E Ed SHaw

              Do you know where I can download the latest version.lib and IPHlpApi.lib for both win32 and x64?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              All these libraries are part of the standard SDK, which (in my case) came automatically with Visual Studio 2010. If you did not get them in this way I guess you need to go to MSDN and search for "Platform SDK".

              It's time for a new signature.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups