mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 12:23:30 +00:00
Mikhail Denisenko <[email protected]>
- RegisterDragDrop should be coupled with a RevokeDragDrop, so add that. - Remove _pDropTarget from class members, it's a var local to DesktopShellView::InitDragDrop() method. See issue #2012 for more details. svn path=/trunk/; revision=41145
This commit is contained in:
@@ -506,24 +506,29 @@ DesktopShellView::DesktopShellView(HWND hwnd, IShellView* pShellView)
|
||||
InitDragDrop();
|
||||
}
|
||||
|
||||
|
||||
DesktopShellView::~DesktopShellView()
|
||||
{
|
||||
if (FAILED(RevokeDragDrop(_hwnd)))
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
||||
bool DesktopShellView::InitDragDrop()
|
||||
{
|
||||
CONTEXT("DesktopShellView::InitDragDrop()");
|
||||
|
||||
_pDropTarget = new DesktopDropTarget(_hwnd);
|
||||
DesktopDropTarget * pDropTarget = new DesktopDropTarget(_hwnd);
|
||||
|
||||
if (!_pDropTarget)
|
||||
if (!pDropTarget)
|
||||
return false;
|
||||
|
||||
_pDropTarget->AddRef();
|
||||
pDropTarget->AddRef();
|
||||
|
||||
if (FAILED(RegisterDragDrop(_hwnd, _pDropTarget))) {
|
||||
_pDropTarget->Release();
|
||||
_pDropTarget = NULL;
|
||||
if (FAILED(RegisterDragDrop(_hwnd, pDropTarget))) {
|
||||
pDropTarget->Release();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
_pDropTarget->Release();
|
||||
|
||||
FORMATETC ftetc;
|
||||
|
||||
@@ -532,7 +537,8 @@ bool DesktopShellView::InitDragDrop()
|
||||
ftetc.tymed = TYMED_HGLOBAL;
|
||||
ftetc.cfFormat = CF_HDROP;
|
||||
|
||||
_pDropTarget->AddSuportedFormat(ftetc);
|
||||
pDropTarget->AddSuportedFormat(ftetc);
|
||||
pDropTarget->Release();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -170,6 +170,7 @@ struct DesktopShellView : public ExtContextMenuHandlerT<SubclassedWindow>
|
||||
typedef ExtContextMenuHandlerT<SubclassedWindow> super;
|
||||
|
||||
DesktopShellView(HWND hwnd, IShellView* pShellView);
|
||||
~DesktopShellView();
|
||||
|
||||
bool InitDragDrop();
|
||||
|
||||
@@ -186,7 +187,6 @@ protected:
|
||||
|
||||
void refresh();
|
||||
|
||||
DesktopDropTarget* _pDropTarget;
|
||||
HWND _hwndListView;
|
||||
int _icon_algo;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user