你必须释放返回的 LPITEMIDLIST:LPMALLOC pMalloc;
//Retrieve a pointer to the shell's IMalloc interface
if(SUCCEEDED(SHGetMalloc(&pMalloc)))
{
// free the PIDL that SHBrowseForFolder returned to us.
pMalloc->Free(pidl);
// release the shell's IMalloc interface
pMalloc->Release();
}
//Retrieve a pointer to the shell's IMalloc interface
if(SUCCEEDED(SHGetMalloc(&pMalloc)))
{
// free the PIDL that SHBrowseForFolder returned to us.
pMalloc->Free(pidl);
// release the shell's IMalloc interface
pMalloc->Release();
}
在通常程序中能使用它而不出错,一旦在cpl程序中使用就出现上面错误。是否在cpl程序中不能用SHBrowseForFolder?