[EXPLORER][BROWSEUI][SHELL32][NETSHELL] Fix wrong usage of CComPtr

This commit is contained in:
Mark Jansen
2022-09-18 20:59:00 +02:00
parent a414c88dae
commit cd2d284142
13 changed files with 23 additions and 41 deletions

View File

@@ -242,8 +242,5 @@ public:
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * m_TrayWnd, IN HWND m_Owner, IContextMenu ** ppCtxMenu)
{
CStartMenuBtnCtxMenu * mnu = new CComObject<CStartMenuBtnCtxMenu>();
mnu->Initialize(m_TrayWnd, m_Owner);
*ppCtxMenu = mnu;
return S_OK;
return ShellObjectCreatorInit<CStartMenuBtnCtxMenu>(m_TrayWnd, m_Owner, IID_PPV_ARG(IContextMenu, ppCtxMenu));
}

View File

@@ -301,8 +301,8 @@ public:
if (ppcm != NULL)
{
m_ContextMenu->AddRef();
*ppcm = m_ContextMenu;
(*ppcm)->AddRef();
}
/* Add the menu items */

View File

@@ -2943,7 +2943,6 @@ ChangePos:
{
CComPtr<IContextMenu> ctxMenu;
CStartMenuBtnCtxMenu_CreateInstance(this, m_hWnd, &ctxMenu);
ctxMenu->AddRef();
TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
}
}