Click here to Skip to main content
11,647,828 members (54,889 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VC8.0 Win32
Hi All,

I need to get the path of shared/public document in XP, vista and windows7.
please give me a code snapshot for this.

i am writing code in windows XP and the same code i want to run in xp, vista and windows7

Thanks in advance.
Posted 6-Apr-11 3:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


See here for more CSIDLs:[^].

[Note: ignore the nonsense about SHGetFolderPath() being deprecated. If you follow the advice in MSDN, your app won't work on XP or earlier systems.]
SAKryukov at 6-Apr-11 18:56pm
Correct (especially with the reference to the CLSID). My 5.
Obsolete SHGetFolderPath is a problem. What, is it invalid for Windows 7? Similar .NET GetFolderPath does work correctly on all systems I know...
Hans Dietrich at 6-Apr-11 22:09pm
No, SHGetFolderPath works fine on Win7. It's the MS-recommended alternative that does not work prior to Vista.
SAKryukov at 7-Apr-11 0:00am
Thank you for your answer, Hans. That's what I say: would require different code for XP and Windows 7. It's easy to implement but... just sad :=<.
Hans Dietrich at 7-Apr-11 0:21am
It's sad, pathetic, idiotic. I run out of words to describe.
SAKryukov at 7-Apr-11 0:37am
Must die.
Jayant Narayan Dash at 7-Apr-11 1:32am
Thanks to all of you for your valuable reply...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 500
1 F-ES Sitecore 370
2 DamithSL 290
3 CPallini 290
4 OriginalGriff 277
0 OriginalGriff 1,342
1 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 845

Advertise | Privacy | Mobile
Web02 | 2.8.150804.4 | Last Updated 6 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100