04-13-2017 05:23 PM
Roberto,
I am wondering if you have observed any differences in behavior for the function VerQueryValue(...) between LabWindows/CVI 2013, and 2015. I have successfully used this (along with supporting) API calls to report version information until trying identical code in CVI 2015, where it exits with failure at this function.
Thanks,
Rick
04-13-2017 06:00 PM
I haven't observed any different behaviour of this function in CVI2015.
Which error do you receive?
04-14-2017 09:34 AM - edited 04-14-2017 09:36 AM
The return type for this function is bool, and it returns a 0.
From MSDN documentation:
Type: BOOL
If the specified version-information structure exists, and version information is available, the return value is nonzero. If the address of the length buffer is zero, no value is available for the specified version-information name.
If the specified name does not exist or the specified resource is not valid, the return value is zero.
Interesting find about the CVI environment though. Opening the exact same workspace file for this project in 2015 and 2013 results in the environment setting up a different mapping to the Version.lib file:
2015:
2013:
Which seems to suggest the Windows Kits\8.1\... version of this library is the culprit...
Let me know if you see the same thing.
04-14-2017 11:06 AM
The position of the Win SDK has changed in CVI2015, I suppose to have it shared across multiple versions. This should not be a problem since the SDK we are installing is always the same (on my machine with CVI 2009, 2012 and 2015 I am running multiple copies of the same "MSDN Library for Visual Studio 2008" even if installed in different folders).
04-19-2017 01:45 AM
@RobertoBozzolo wrote:
The position of the Win SDK has changed in CVI2015, I suppose to have it shared across multiple versions.
While this is true, the SDK version was also changed in CVI 2015 - see Release notes - page 5: Updated Windows SDK.
@ryk: Did you try running the program with administrator rights? It might make a difference but I'm not sure.
Constantin
04-19-2017 08:08 AM
Constantin,
Your observation that the SDK version was changed is interesting and useful. Given I am using identical project files, and the only difference is that I open (using the workspace file) in 2013 or 2015, and the point at which the code fails, it really does point to the SDK at this point. I handed this off to tech support. So far they have not been able to duplicate the problem.
By the way, I have run both in elevated and non-elevated UAC modes. It does not seem to affect the outcome.
Thank you,
Rick
05-12-2017 09:29 AM
While it's true that the SDK changed between CVI 2013 and CVI 2015, what changed was only the set of headers and import libraries. The actual implementation of that function is provided by api-ms-win-core-console-l1-1-0.dll, which is part of your Windows installation (in Windows/system32). So, while .h and .lib files can affect the compile-time and link-time behavior of your program, they typically do not affect the runtime behavior, unless there was some compiler warning that you might not have noticed.
Having said that, have you tried temporarily renaming your SDK .h and .lib folders so that CVI 2015 would use the previous SDK, just to see if that makes a difference?