Skip to content

Commit

Permalink
Merged revision(s) 455 from trunk:
Browse files Browse the repository at this point in the history
Minor modification to the CFileContextMenuManager constructor. Previously, if GetUIObjectOf, or one of the shell functions failed, the m_pShellContext* members would not be initialized.
........
  • Loading branch information
derceg committed Nov 8, 2011
1 parent 582957a commit 39671a7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Explorer++/Helper/FileContextMenuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<LPITEMIDLIST> pidlItemList)
LPITEMIDLIST pidlParent,std::list<LPITEMIDLIST> 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));
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 39671a7

Please sign in to comment.