LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get "Product Version" for my application

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

0 Kudos
Message 11 of 17
(972 Views)

I haven't observed any different behaviour of this function in CVI2015.

Which error do you receive?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 12 of 17
(970 Views)

The return type for this function is bool, and it returns a 0. 

From MSDN documentation:

Return value:

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:

2015.JPG

2013:

2013.JPG

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.

0 Kudos
Message 13 of 17
(960 Views)

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).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 14 of 17
(955 Views)

@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

 

0 Kudos
Message 15 of 17
(931 Views)

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

0 Kudos
Message 16 of 17
(920 Views)

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?

0 Kudos
Message 17 of 17
(861 Views)