Initialize COM prior to displaying the file dialog.

This commit is contained in:
Michael Jung 2005-11-09 12:55:01 +00:00 committed by Alexandre Julliard
parent 5c63332b4f
commit 6eb0c35344
2 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE = comdlg32.dll MODULE = comdlg32.dll
IMPORTLIB = libcomdlg32.$(IMPLIBEXT) IMPORTLIB = libcomdlg32.$(IMPLIBEXT)
IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 advapi32 kernel32 ntdll IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 advapi32 kernel32 ntdll
DELAYIMPORTS = ole32
EXTRALIBS = -luuid EXTRALIBS = -luuid
C_SRCS = \ C_SRCS = \

View File

@ -250,6 +250,7 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
LPCVOID template; LPCVOID template;
HRSRC hRes; HRSRC hRes;
HANDLE hDlgTmpl = 0; HANDLE hDlgTmpl = 0;
HRESULT hr;
/* test for missing functionality */ /* test for missing functionality */
if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
@ -281,11 +282,16 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA); fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA);
} }
/* Some shell namespace extensions depend on COM being initialized. */
hr = CoInitialize(NULL);
lRes = DialogBoxIndirectParamA(COMDLG32_hInstance, lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
(LPDLGTEMPLATEA) template, (LPDLGTEMPLATEA) template,
fodInfos->ofnInfos->hwndOwner, fodInfos->ofnInfos->hwndOwner,
FileOpenDlgProc95, FileOpenDlgProc95,
(LPARAM) fodInfos); (LPARAM) fodInfos);
if (SUCCEEDED(hr))
CoUninitialize();
/* Unable to create the dialog */ /* Unable to create the dialog */
if( lRes == -1) if( lRes == -1)