I have a problem with SHGetFolderPathA in Visual Studio 2010 (Windows Forms).
I included to project ShlObj.h
and added for button this code:
char SciezkaCookies[MAX_PATH];
HRESULT hr = ::SHGetFolderPathA(0, CSIDL_APPDATA, 0, SHGFP_TYPE_DEFAULT, SciezkaCookies);
But when i try compile my project, Visual return errors:
error LNK2028: unresolved token (0A000012) "extern "C" long stdcall SHGetFolderPathA(struct HWND *,int,void *,unsigned long,char *)" (?SHGetFolderPathA@@$$J220YGJPAUHWND__@@HPAXKPAD@Z) referenced in function "private: void __clrcall VoxPopuli::Form1::start_Click(class System::Object ^,class System::EventArgs ^)" (?start_Click@Form1@VoxPopuli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
and
1>VoxPopuli.obj : error LNK2019: unresolved external symbol "extern "C" long stdcall SHGetFolderPathA(struct HWND *,int,void *,unsigned long,char *)" (?SHGetFolderPathA@@$$J220YGJPAUHWND__@@HPAXKPAD@Z) referenced in function "private: void __clrcall VoxPopuli::Form1::start_Click(class System::Object ^,class System::EventArgs ^)" (?start_Click@Form1@VoxPopuli@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
I'm looking for solutions in google, but all examples is not working ;/
Thanks for help!