Initialize COM prior to displaying the SHBrowseForFolder dialog.

This commit is contained in:
Michael Jung 2005-11-09 10:30:28 +00:00 committed by Alexandre Julliard
parent 57707fa0ea
commit 0acf88651d
1 changed files with 4 additions and 0 deletions

View File

@ -672,14 +672,18 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
{
browse_info info;
DWORD r;
HRESULT hr;
info.hWnd = 0;
info.pidlRet = NULL;
info.lpBrowseInfo = lpbi;
info.hwndTreeView = NULL;
hr = CoInitialize(NULL);
r = DialogBoxParamW( shell32_hInstance, swBrowseTemplateName, lpbi->hwndOwner,
BrsFolderDlgProc, (LPARAM)&info );
if (SUCCEEDED(hr))
CoUninitialize();
if (!r)
return NULL;