LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

A better way to get AppData location?

Solved!
Go to solution

Okay, thanks.  One note to others - I have the NI Developer Suite DVD set.  When choosing to install the LabWindows/CVI 2009 Development System, you need to choose "Custom Install" in order for the menu Luis has shown to appear during the installation.  The normal "Install" skips this screen.

 

0 Kudos
Message 11 of 18
(2,861 Views)

The problem is that the SDK of CVI 2013 is configured to use the XP API which does not know SHGetKnownFolderPath().

 

Does anyone know how to reconfigure the SDK to use Win7 API? I don't like to change SDK header due the project will be compiled on different machines.

 

Regards

 

AutomationGuy

0 Kudos
Message 12 of 18
(2,418 Views)

By default, CVI sets the SDK version to be the highest version that supports all the operating system versions that CVI itself supports. But you can change this, without having to change the headers themselves, by simply redefining those macros in the Build Options.

 

For the SDK, in general, you should redefine WINVER, _WIN32_WINNT and _WIN32_WINDOWS. But for that particular API, you should redefine NTDDI_VERSION instead:

 

winver.png

 

 

0 Kudos
Message 13 of 18
(2,396 Views)

Looking for a solution to finding the default AppData location and found this old thread.  LouisG indicated this might be included for future versions of CVI.  I can't find anything in the help document about it.

 

Is there now something in CVI which does this?

 

Or, do I have to use SHGetFolderLocation()?  If so, does anyone have a sample project doing this?

 

Thanks,

 

Dave

0 Kudos
Message 14 of 18
(2,173 Views)

There isn't anything new in CVI to do this, so you still have to use SHGetFolderPath. As far as sample code is concerned, it should be as simple as doing this:

 

SHGetFolderPath (0, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, path);

0 Kudos
Message 15 of 18
(2,146 Views)

I had to add also shell32.lib to the project to resolve symbols (CVI2015SP1 on Win10)



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 16 of 18
(2,137 Views)

Thanks Luis and Roberto.  I think that answers everything.

 

Dave

0 Kudos
Message 17 of 18
(2,131 Views)

Why is writing default data directory, path in the registry? The language specific information can be added during the first run ...

0 Kudos
Message 18 of 18
(2,058 Views)