The SHBrowseForFolder() function with BROWSEFORPRINTER flag
returns NULL in Vista.
The following is the code snippet.
============================================
char pszDisplayName[MAX_PATH];
LPITEMIDLIST lpID;
BROWSEINFOA bi;
LPITEMIDLIST pIdl_NW = NULL;
SHGetSpecialFolderLocation(NULL, CSIDL_NETWORK, &pIdl_NW);
bi.hwndOwner = hwndOwner;
bi.pidlRoot = pIdl_NW;
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle = lpszTitle;
bi.ulFlags = BIF_BROWSEFORPRINTER ;
bi.lpfn = BrowseCallbackProc;
bi.iImage = NULL;
HRESULT hres = CoInitialize(NULL);
lpID = SHBrowseForFolderA(&bi);
============================================
Here IpID is NULL in Vista.
Can anyone tell me what is wrong in teh above snippet which has impact
in Vista????
Thanks in Advance
Lucky
> The SHBrowseForFolder() function with BROWSEFORPRINTER flag
> returns NULL in Vista.
What does GetLastError() return after SHBrowseForFolder() fails?
> The SHBrowseForFolder() function with BROWSEFORPRINTER flag
> returns NULL in Vista.
I would try adding a call to ZeroMemory for the BROWSEINFOA bi
structure.
Jussi Jumppanen
Zeus for Windows - "The ultimate programmer's editor/IDE"
http://www.zeusedit.com
Thanks in Advance
Lucky