LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Working directory

Hello all,

that's probably an easy question for most of you, but I usually develop for Linux with CVI running in XP. But someone recently tried on of my prog in Win7 and ran into trouble because I was (by default, this is user settable) using ini files and saving data in the default directory, which is the program directory, which seems write protected under Win7. So it was failing.

 

I'm unfamiliar with Win7 and just had a look at the functions around GetDir() without seeing an easy way to obtain a user-owned directory automatically. What's the recommended way to do this nowadays ?

Thanks

0 Kudos
Message 1 of 5
(4,397 Views)

Starting from Win7 (or Vista, I don't remember) Microsoft has introduce the Application Data folder which should be the default path where to place user files.

The path of this folder can be retrieved with some SDK calls: see this thread for a discussion about that.



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 2 of 5
(4,384 Views)

The better link may be this one Smiley Wink it is independent of your posts-per-page setting

0 Kudos
Message 3 of 5
(4,382 Views)

Having to install the whole Windows SDK and include the whole Windows.h JUST to know where you can save your files ? That's just insane and a [redacted] waste of time. Thanks anyway, I guess I'll have to do it.

0 Kudos
Message 4 of 5
(4,334 Views)

I understand your displeasure for that if this is your only use of windows API; on my side I usually install my apps in a first-level folder (let's say c:\app) to avoid the complexity of default c:\program files\producer\application path. This has the additional advantage of not having to struggle with privileges and so on. Microsoft may complain that I'm not "politically correct" but it works.

If you want to maintain the default c:program files\...  install folder you can always go the older way: create your own working directory in the root of the hard disk and use it.



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 5 of 5
(4,330 Views)