Jens Doose wrote: The problem is that with Windows XP Have you tried this on another platform to see if it is OS related? Jens Doose wrote: That is why there is no error checking or why I don't use the result value within bi. That's fine, and is common practice. I just wanted to emphasize that omitting error checking might have been the crux of the problem. If you commented out both calls to SHBrowseForFolder(), thus leaving only the SQL-related code, can Go() be called repeatedly? Perhaps after you are done with SHBrowseForFolder(), you should call IMalloc::Free().
HRESULT hr;
LPMALLOC pMalloc;
LPITEMIDLIST pidlSelected = NULL;
hr = SHGetMalloc(&pMalloc);
pidlSelected = SHBrowseForFolder(&bi);
...
pMalloc->Free(pidlSelected);