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,