Skip to content
Snippets Groups Projects
Commit 6eb0c353 authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard
Browse files

Initialize COM prior to displaying the file dialog.

parent 5c63332b
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE = comdlg32.dll
IMPORTLIB = libcomdlg32.$(IMPLIBEXT)
IMPORTS = shell32 shlwapi comctl32 winspool user32 gdi32 advapi32 kernel32 ntdll
DELAYIMPORTS = ole32
EXTRALIBS = -luuid
C_SRCS = \
......
......@@ -250,6 +250,7 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
LPCVOID template;
HRSRC hRes;
HANDLE hDlgTmpl = 0;
HRESULT hr;
/* test for missing functionality */
if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
......@@ -281,11 +282,16 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos)
fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA);
}
/* Some shell namespace extensions depend on COM being initialized. */
hr = CoInitialize(NULL);
lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
(LPDLGTEMPLATEA) template,
fodInfos->ofnInfos->hwndOwner,
FileOpenDlgProc95,
(LPARAM) fodInfos);
if (SUCCEEDED(hr))
CoUninitialize();
/* Unable to create the dialog */
if( lRes == -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment