Prev: VC++ .NET 2003 - Compilation Error C2976
Next: How to create a FlexGrid dynamically (using MSFlxGrd.ocx)
From: kathy on 16 Jan 2006 12:15 In my code, I try to use the SHGetFolderPath(). I already include the header file "ShlObj.h". But when I try to build it, I got: c:\temp\MyCode\MyCodeDlg.cpp(277): error C3861: 'SHGetFolderPath': identifier not found, even with argument-dependent lookup
From: Vipin on 16 Jan 2006 12:30 define _WIN32_IE=0x500 in your preprocessor defines and add shell32.lib in your linker libraries list. Then in your code:- have this #include <shlobj.h> void main() { ShGetFolderPath(...); } Make sure your platform sdk header files precede in the include path order and the sdk library path also precedes the library path Also remember using ShGetFolderPath would make your programs non-functional on operating systems like 98, so you had better do like this #define _WIN32_IE 0x5000 #include <shlobj.h> typedef SHFOLDERAPI (*pfnSHGetFolderPathA)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); typedef SHFOLDERAPI (*pfnSHGetFolderPathA)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); main() { HMODULE hmod = LoadLibrary(_T("shell32.dll")); pfnSHGetFolderPathA ptr = (pfnSHGetFolderPathA) GetProceAddress(hmod , "SHGetFolderPathA"); if(ptr) ptr(...) else // on unsupported operating systems { } } -- Vipin Aravind Microsoft - MVP "kathy" <yqin_99(a)yahoo.com> wrote in message news:1137431711.947332.46610(a)g49g2000cwa.googlegroups.com... > In my code, I try to use the SHGetFolderPath(). I already include the > header file "ShlObj.h". But when I try to build it, I got: > > c:\temp\MyCode\MyCodeDlg.cpp(277): error C3861: 'SHGetFolderPath': > identifier not found, even with argument-dependent lookup >
From: kathy on 16 Jan 2006 14:14 "Make sure your platform sdk header files precede in the include path order and the sdk library path also precedes the library path " How to do this?
From: Vipin on 16 Jan 2006 14:22 For vs .net2003 , it is tools->options->projects->vc++ directories->Show directories for: Library files. Add the new path at the end of the list and move them up the list using the up arrow. -- Vipin Aravind Microsoft - MVP "kathy" <yqin_99(a)yahoo.com> wrote in message news:1137438857.898289.301820(a)g47g2000cwa.googlegroups.com... > "Make sure your platform sdk header files precede in the include path > order > and the sdk library path also precedes the library path " > > How to do this? >
From: kathy on 16 Jan 2006 15:35 thanks
|
Next
|
Last
Pages: 1 2 3 4 Prev: VC++ .NET 2003 - Compilation Error C2976 Next: How to create a FlexGrid dynamically (using MSFlxGrd.ocx) |