I am using the SHGetSpecialFolderLocation API function . My app is set to "Use Unicode Character Set".
Here is what I still have:
int main ( int, char ** )
{
LPITEMIDLIST pidl;
HRESULT hr = SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &pidl);
wstring wstrPath;
wstrPath.resize ( _MAX_PATH );
BOOL f = SHGetPathFromIDList(pidl, wstrPath.c_str () );
The error I am getting is:
error C2664: 'SHGetPathFromIDListW' : cannot convert parameter 2 from 'const wchar_t *' to 'LPWSTR'
Can anyone help? What is the correct C ++ way to do this?
Thank!
source
share