Using IDropTarget in an explorer browser bar causes Javascript ondragenter to fail
- From: "tuftsmoose" <tuftsmoose@xxxxxxxxxxx>
- Date: 8 Jul 2005 08:02:10 -0700
I have created a dll for a browser bar in IE and it is working quite
well up to this point, the problem I have encountered is when I add
Drag and Drop functionality. I implemented IDropTarget and caught the
Drop call. This too worked fine. The problem is that once I implement
IDropTarget I am no longer recieving the Javascript "ondragenter" event
(or any other drag related events) in the browser object. If I remove
the IDropTarget portion of the code, this works fine. Here are the
relevent IDropTarget code snippits (I removed everything that was not
related to drag drop):
// main class
class ATL_NO_VTABLE mybar :
...
public IDropTarget,
...
{
// COM map
BEGIN_COM_MAP(mybar)
COM_INTERFACE_ENTRY(mybar)
COM_INTERFACE_ENTRY(IDropTarget)
...
END_COM_MAP()
// IDropTarget Implementations
STDMETHODIMP DragEnter(IDataObject *pDataObject, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect )
{
*pdwEffect = DROPEFFECT_COPY;
return S_OK;
}
STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
{
*pdwEffect = DROPEFFECT_COPY;
return S_OK;
}
STDMETHODIMP DragLeave()
{
return S_OK;
}
STDMETHODIMP Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL
pt, DWORD *pdwEffect)
{
// get the file names etc...
...
return S_OK;
}
// IDocHostUIHandlerDispatch Implementations
....
virtual HRESULT STDMETHODCALLTYPE GetDropTarget(/* [in] */ IUnknown
*pDropTarget, /* [out] */ IUnknown **ppDropTarget)
{
CComPtr<IDropTarget>pDT(this);
*ppDropTarget = pDT;
return S_OK;
}
....
// mybar Implementations
OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL&
/*bHandled*/)
{
...
// I get the same results whether or not I make this call...
RegisterDragDrop(m_hWnd, static_cast<IDropTarget *>(this));
...
}
.
- Follow-Ups:
- Prev by Date: atlsoap for wince / msxml
- Next by Date: Re: COM replacement for BYTE* type?
- Previous by thread: atlsoap for wince / msxml
- Next by thread: Re: Using IDropTarget in an explorer browser bar causes Javascript ondragenter to fail
- Index(es):