From 39671a7ca7f53eaf25b4982c341675513165455d Mon Sep 17 00:00:00 2001 From: David Erceg Date: Tue, 8 Nov 2011 07:03:09 +0000 Subject: [PATCH] Merged revision(s) 455 from trunk: Minor modification to the CFileContextMenuManager constructor. Previously, if GetUIObjectOf, or one of the shell functions failed, the m_pShellContext* members would not be initialized. ........ --- Explorer++/Helper/FileContextMenuManager.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Explorer++/Helper/FileContextMenuManager.cpp b/Explorer++/Helper/FileContextMenuManager.cpp index 502d63de37..6b5568bd02 100644 --- a/Explorer++/Helper/FileContextMenuManager.cpp +++ b/Explorer++/Helper/FileContextMenuManager.cpp @@ -22,14 +22,16 @@ LRESULT CALLBACK ShellMenuHookProcStub(HWND hwnd,UINT Msg,WPARAM wParam, LPARAM lParam,UINT_PTR uIdSubclass,DWORD_PTR dwRefData); CFileContextMenuManager::CFileContextMenuManager(HWND hwnd, - LPITEMIDLIST pidlParent,std::list pidlItemList) + LPITEMIDLIST pidlParent,std::list pidlItemList) : +m_hwnd(hwnd), +m_pidlParent(ILClone(pidlParent)), +m_pShellContext3(NULL), +m_pShellContext2(NULL), +m_pShellContext(NULL) { IContextMenu *pContextMenu = NULL; HRESULT hr; - m_hwnd = hwnd; - m_pidlParent = ILClone(pidlParent); - for each(auto pidl in pidlItemList) { m_pidlItemList.push_back(ILClone(pidl)); @@ -87,10 +89,6 @@ CFileContextMenuManager::CFileContextMenuManager(HWND hwnd, if(SUCCEEDED(hr)) { - m_pShellContext3 = NULL; - m_pShellContext2 = NULL; - m_pShellContext = NULL; - /* First, try to get IContextMenu3, then IContextMenu2, and if neither of these are available, IContextMenu. */ hr = pContextMenu->QueryInterface(IID_IContextMenu3,