I'm using the SHGetFolderPath function to get the path of the personal
folder. It works fine on XP, but gives the following error on NT: "Can't
find entrypoint of procedure SHGetFolderPathA in DLL shell32.dll".
Both IE6 and SP6 are installed, but it still doesn't work. What did I do
wrong?
MSDN says:
Function Information
Minimum DLL Version shell32.dll version 5.0 or later
Custom Implementation No
Header shlobj.h
Import library None
Minimum operating systems Windows 95 with Internet Explorer 5.0,
Windows 98 with Internet Explorer 5.0, Windows 98 Second Edition (SE),
Windows NT 4.0 with Internet Explorer 5.0, Windows NT 4.0 with Service Pack
4 (SP4)
Olaf van der Spek
Almere, Holland
http://xccu.sourceforge.net/
You have to ensure that your program is linked so that it tries to
access this function via SHFolder.dll rather than shell32.dll.
If you add shfolder.lib first in your list of linked libraries, this
should do the trick.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Thanks. But does this mean MSDN is wrong about "shell32.dll version 5.0 or
later"?
No, it's just not telling you the more complete story in that table.
The remarks section of the documentation on that function notes:
"On systems preceeding those including Shell32.dll version 5.0
(Windows Millennium Edition (Windows Me) and Windows 2000),
SHGetFolderPath was obtained through SHFolder.dll, distributed with
Microsoft Internet Explorer 4.0 and later versions. SHFolder.dll
always calls the current platform's version of this function. If that
fails, it will try to simulate the appropriate behavior. SHFolder.dll
continues to be included for backward compatibility, though the
function is now implemented in Shell32.dll.