CString strPath;
LPITEMIDLIST lpi = NULL;
IShellFolder * m_lpsfDesktop;
CHAR path[MAX_PATH];
OLECHAR szOleStr[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
strPath.Format( " %s " , path);
// 使用桌面的IShellFolder来转换,这将生成一个绝对的PIDL
SHGetDesktopFolder( & m_lpsfDesktop);
// 将路径转换成宽字符格式
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED, strPath, - 1 , szOleStr, sizeof (szOleStr));
// 转换路径
m_lpsfDesktop -> ParseDisplayName(NULL, NULL, szOleStr, NULL, & lpi, NULL);
// 释放接口
m_lpsfDesktop -> Release();
LPITEMIDLIST lpi = NULL;
IShellFolder * m_lpsfDesktop;
CHAR path[MAX_PATH];
OLECHAR szOleStr[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
strPath.Format( " %s " , path);
// 使用桌面的IShellFolder来转换,这将生成一个绝对的PIDL
SHGetDesktopFolder( & m_lpsfDesktop);
// 将路径转换成宽字符格式
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED, strPath, - 1 , szOleStr, sizeof (szOleStr));
// 转换路径
m_lpsfDesktop -> ParseDisplayName(NULL, NULL, szOleStr, NULL, & lpi, NULL);
// 释放接口
m_lpsfDesktop -> Release();