VS2010 - version and copyright and GetAdapters
-
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
-
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
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.
-
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.
-
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
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
-
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
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
-
Do you know where I can download the latest version.lib and IPHlpApi.lib for both win32 and x64?