SetNameOf
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I'm using the SetNameOf function to rename a folder relative to its parent folder. The Renaming works well but the pidl I get back is not the one I expect. When I rename C:\Foo\Bar to C:\Foo\Bar.temp the pidl I get back corresponds to C:\Documents and Settings\Arjan\Desktop\Bar.temp
LPCOLESTR lpNewName = A2OLE(GetItemText(m_hLockedItem)); LPITEMIDLIST pidlNew; HRESULT hr = pParentFolder->SetNameOf(AfxGetMainWnd()->GetSafeHwnd(), pidlRel, lpNewName, SHGDN_INFOLDER, &pidlNew); CString s; SHGetPathFromIDList(pidlNew, s.GetBuffer(MAX_PATH)); s.ReleaseBuffer();
What am I doing wrong here? Thanks, Arjan.